# HG changeset patch # User Sebastien Jodogne # Date 1534408770 -7200 # Node ID 9a0c6a046cc2f7d7d9abf331f2975a5e47bb3f3b # Parent 4df3c64402ba404d870c80ddf4ba96f10d77ee8e Fix handling of incoming C-FIND queries containing Generic Group Length (*, 0x0000) diff -r 4df3c64402ba -r 9a0c6a046cc2 Core/DicomParsing/ParsedDicomFile.cpp --- a/Core/DicomParsing/ParsedDicomFile.cpp Fri Jul 27 16:40:09 2018 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.cpp Thu Aug 16 10:39:30 2018 +0200 @@ -525,6 +525,13 @@ void ParsedDicomFile::Clear(const DicomTag& tag, bool onlyIfExists) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmItem* dicom = pimpl_->file_->getDataset(); @@ -612,6 +619,13 @@ const Json::Value& value, bool decodeDataUriScheme) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + if (pimpl_->file_->getDataset()->tagExists(ToDcmtkBridge::Convert(tag))) { throw OrthancException(ErrorCode_AlreadyExistingTag); @@ -724,6 +738,13 @@ bool decodeDataUriScheme, DicomReplaceMode mode) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmDataset& dicom = *pimpl_->file_->getDataset(); @@ -756,6 +777,13 @@ bool decodeDataUriScheme, DicomReplaceMode mode) { + if (tag.GetElement() == 0x0000) + { + // Prevent manually modifying generic group length tags: This is + // handled by DCMTK serialization + return; + } + InvalidateCache(); DcmDataset& dicom = *pimpl_->file_->getDataset(); diff -r 4df3c64402ba -r 9a0c6a046cc2 NEWS --- a/NEWS Fri Jul 27 16:40:09 2018 +0200 +++ b/NEWS Thu Aug 16 10:39:30 2018 +0200 @@ -5,6 +5,7 @@ * Fix incoming DICOM C-Store filtering for JPEG-LS transfer syntaxes * Fix OrthancPluginHttpClient() to return the HTTP status on errors * Fix HTTPS requests to sites using a certificate encrypted with ECDSA +* Fix handling of incoming C-FIND queries containing Generic Group Length (*, 0x0000) Version 1.4.1 (2018-07-17)