d/patches: Fix CVE-2022-43272. Closes: #1027165
authorMathieu Malaterre <malat@debian.org>
Wed, 4 Jan 2023 10:13:03 +0000 (11:13 +0100)
committerMathieu Malaterre <malat@debian.org>
Wed, 4 Jan 2023 10:14:53 +0000 (11:14 +0100)
debian/patches/c34f4e46e672ad21accf04da0dc085e43be6f5e1.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/c34f4e46e672ad21accf04da0dc085e43be6f5e1.patch b/debian/patches/c34f4e46e672ad21accf04da0dc085e43be6f5e1.patch
new file mode 100644 (file)
index 0000000..975b971
--- /dev/null
@@ -0,0 +1,55 @@
+From c34f4e46e672ad21accf04da0dc085e43be6f5e1 Mon Sep 17 00:00:00 2001
+From: Marco Eichelberg <dicom@offis.de>
+Date: Thu, 9 Jun 2022 10:03:38 +0200
+Subject: [PATCH] Fixed memory leak in single process mode.
+
+Fixed a memory leak in dcmqrscp's single process mode.
+
+Thanks to <songxiangpu@mail.sdu.edu.cn> for the bug report and test data.
+---
+ dcmqrdb/libsrc/dcmqrsrv.cc | 24 ++++++++++--------------
+ 1 file changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/dcmqrdb/libsrc/dcmqrsrv.cc b/dcmqrdb/libsrc/dcmqrsrv.cc
+index 157e6c022..f5f9df661 100644
+--- a/dcmqrdb/libsrc/dcmqrsrv.cc
++++ b/dcmqrdb/libsrc/dcmqrsrv.cc
+@@ -1,6 +1,6 @@
+ /*
+  *
+- *  Copyright (C) 1993-2021, OFFIS e.V.
++ *  Copyright (C) 1993-2022, OFFIS e.V.
+  *  All rights reserved.  See COPYRIGHT file for details.
+  *
+  *  This software and supporting documentation were developed by
+@@ -1126,21 +1126,17 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
+ #endif
+     }
+-    // cleanup code
++    // clean-up association
+     OFCondition oldcond = cond;    /* store condition flag for later use */
+-    if (!options_.singleProcess_ && (cond != ASC_SHUTDOWNAPPLICATION))
++    cond = ASC_dropAssociation(assoc);
++    if (cond.bad())
+     {
+-        /* the child will handle the association, we can drop it */
+-        cond = ASC_dropAssociation(assoc);
+-        if (cond.bad())
+-        {
+-            DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond));
+-        }
+-        cond = ASC_destroyAssociation(&assoc);
+-        if (cond.bad())
+-        {
+-            DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond));
+-        }
++        DCMQRDB_ERROR("Cannot Drop Association: " << DimseCondition::dump(temp_str, cond));
++    }
++    cond = ASC_destroyAssociation(&assoc);
++    if (cond.bad())
++    {
++        DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond));
+     }
+     if (oldcond == ASC_SHUTDOWNAPPLICATION) cond = oldcond; /* abort flag is reported to top-level wait loop */
index 020d58e20bdbcf397c0e6c4baa80f3cd18af9650..f058fe85ef4bcc66389eeb3c65820b2d4edcb00b 100644 (file)
@@ -9,3 +9,4 @@
 #ab61e8577ff0974efcfae2907c48baf6023c1160.patch
 #1c8cca4bf6f7c92fc16f9e66faf49409c891a2b0.patch
 f06a867513524664a1b03dfcf812d8b60fdd02cc.patch
+c34f4e46e672ad21accf04da0dc085e43be6f5e1.patch