Repository navigation
dcmnet: copy alwaysAcceptDefaultRole_ in DcmAssociationConfiguration copy/assign - #168
Closed
lauyeehow1986-hub wants to merge 1 commit into
Closed
lauyeehow1986-hub wants to merge 1 commit into
lauyeehow1986-hub wants to merge 1 commit into
Conversation
…tion copy/assign.
Member
|
Thank you for the report :) I just merged it into our internal testing branch. The fix will be visible within the next few days on public master branch. |
Member
|
FYI: Issue in DCMTK bug tracker: https://support.dcmtk.org/redmine/issues/1309 |
michaelonken
added a commit
that referenced
this pull request
Nov 23, 2026
The copy constructor of DcmAssociationConfiguration did not initialize alwaysAcceptDefaultRole_ and the copy assignment operator did not copy it. This affected, e.g., all workers of an SCP pool. Thanks to GitHub user "lauyeehow1986-hub" for the report and pull request. This closes GitHub PR #168 and DCMTK issue #1309.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an uninitialized
OFBoolmember (alwaysAcceptDefaultRole_) inDcmAssociationConfiguration's copy constructor and missing copy inDcmAssociationConfiguration::operator=.Problem & Root Cause
Running DCMTK's test suite under Clang ASan + UBSan (
-fsanitize=address,undefined) onmaster(e8d3d701) fails test301 - dcmtls_scp_pool_tls:DcmAssociationConfiguration::DcmAssociationConfiguration(const DcmAssociationConfiguration& arg)(dcmnet/libsrc/dcasccfg.cc) omittedalwaysAcceptDefaultRole_(arg.alwaysAcceptDefaultRole_)from its member initializer list, leavingalwaysAcceptDefaultRole_uninitialized whenever aDcmAssociationConfiguration(orDcmSCPConfig) was copy-constructed (e.g., whenDcmSCPPoolconstructs workerDcmThreadSCPinstances).DcmAssociationConfiguration::operator=(const DcmAssociationConfiguration& arg)calledthis->clear()(resettingalwaysAcceptDefaultRole_toOFFalse) and omittedalwaysAcceptDefaultRole_ = arg.alwaysAcceptDefaultRole_;.Changes
dcmnet/libsrc/dcasccfg.cc:alwaysAcceptDefaultRole_(arg.alwaysAcceptDefaultRole_)in the copy constructor.alwaysAcceptDefaultRole_ = arg.alwaysAcceptDefaultRole_;inoperator=.dcmnet/tests/tparseassoc.cc&dcmnet/tests/tests.cc:OFTEST(dcmnet_assoc_cfg_copy_alwaysAcceptDefaultRole)verifying both default (OFFalse) initialization/preservation and explicitOFTruepreservation across copy construction and copy assignment.Verification
Built on Ubuntu 24.04 with Clang (
-fsanitize=address,undefined, LSan enabled,-DDCMTK_ENABLE_CXX11=ON,-DDCMTK_DEFAULT_DICT=builtin):ctest --output-on-failure: 551/551 tests passed (100%), includingdcmtls_scp_pool_tlsanddcmnet_assoc_cfg_copy_alwaysAcceptDefaultRole.