# HG changeset patch # User Alain Mazy # Date 1732189886 -3600 # Node ID ff0b54e8bc716b3659ab847d765f288ac9b144b8 # Parent 3ed63202eff8334b38ca9e2fd0e2fa4b070dc917 Fix deadlock when parsing specific invalid DICOM files diff -r 3ed63202eff8 -r ff0b54e8bc71 NEWS --- a/NEWS Tue Nov 12 18:03:34 2024 +0100 +++ b/NEWS Thu Nov 21 12:51:26 2024 +0100 @@ -29,7 +29,8 @@ * Fix C-Find queries not returning private tags in the modality worklist plugin. * Fix extremely rare error when 2 threads are trying to create the same folder in the File Storage at the same time. -* Fix crashes if handling very large images +* Fix crashes if handling very large images. +* Fix deadlock when parsing specific invalid DICOM files. * Metrics: - fix a few metrics that were not published - added 2 metrics: orthanc_storage_cache_miss_count & orthanc_storage_cache_hit_count diff -r 3ed63202eff8 -r ff0b54e8bc71 OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp --- a/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Tue Nov 12 18:03:34 2024 +0100 +++ b/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Thu Nov 21 12:51:26 2024 +0100 @@ -247,6 +247,10 @@ pos += length + 12; } + else + { + throw OrthancException(ErrorCode_BadFileFormat, "Invalid DICOM File: Unable to parse Meta Header"); + } } if (pos != block.size())