Fix A-ASSOCIATE-RQ/AC error-path leaks in DUL FSM.
authorMichael Onken <onken@open-connections.de>
Mon, 6 Jul 2026 20:39:03 +0000 (22:39 +0200)
committerÉtienne Mollier <emollier@debian.org>
Mon, 6 Jul 2026 20:39:03 +0000 (22:39 +0200)
commit361f28a7bf90e54153289d13b22265e8d37c1786
tree72540f0413e5f738ed2bd0fe0be550cba55c0fe4
parent9d8172861997e769cdbf7ff3ce30c89bf12d051a
Fix A-ASSOCIATE-RQ/AC error-path leaks in DUL FSM.

Applied-Upstream: 2312891a8d058c862e00bcbd636e5da26308658a
Last-Update: 2026-05-29
Reviewed-By: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/1141411

AE_3_AssociateConfirmationAccept and AE_6_ExamineAssociateRequest leaked
the whole parsed PDU graph (presentation contexts, transfer syntax
sub-chains, role list, user info) on error returns taken after
parseAssociate() succeeded, since only the success path freed it. For an
SCP this is remotely triggerable and accumulates per connection.

Free the parsed PDU before each such return;
translatePresentationContextList() also frees the proposed transfer
syntax list of a rejected context. Add a dcmnet regression test
(tassocleak.cc) driving the AE_6 zero-transfer-syntax path against an
in-process DcmSCP; leak-clean with the fix under DCMTK_WITH_SANITIZERS.

Thanks for the report and analysis to Abhinav Agarwal.

This closes DCMTK issue #1217.

Gbp-Pq: Name CVE-2026-35505.patch
dcmnet/libsrc/dulfsm.cc
dcmnet/tests/CMakeLists.txt
dcmnet/tests/Makefile.in
dcmnet/tests/tassocleak.cc [new file with mode: 0644]
dcmnet/tests/tests.cc