Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:16.0:FactoryCandidates
dcmtk
0003-Fixed-wrong-error-handling-previous-commit...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-Fixed-wrong-error-handling-previous-commit.patch of Package dcmtk
From 7d54f8efec995e5601d089fa17b0625c2b41af23 Mon Sep 17 00:00:00 2001 From: Joerg Riesmeier <dicom@jriesmeier.com> Date: Mon, 22 Apr 2024 12:11:11 +0200 Subject: [PATCH 3/3] Fixed wrong error handling (previous commit). Fixed wrong error handling introduced with the previous commit. --- dcmrt/libsrc/drttypes.cc | 6 +++--- dcmsr/libsrc/dsrtypes.cc | 32 ++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/dcmrt/libsrc/drttypes.cc b/dcmrt/libsrc/drttypes.cc index 77ff1674c..097ab9727 100644 --- a/dcmrt/libsrc/drttypes.cc +++ b/dcmrt/libsrc/drttypes.cc @@ -210,11 +210,11 @@ OFCondition DRTTypes::getAndCheckStringValueFromDataset(DcmItem &dataset, { DcmStack stack; OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); - if (result.good() && stack.top()->isElement()) + if (result.good()) { - DcmElement *element = OFstatic_cast(DcmElement *, stack.top()); - if (element != NULL) + if (stack.top()->isElement()) { + DcmElement *element = OFstatic_cast(DcmElement *, stack.top()); if (checkElementValue(*element, vm, type, result, moduleName)) result = element->getOFString(stringValue, 0); else diff --git a/dcmsr/libsrc/dsrtypes.cc b/dcmsr/libsrc/dsrtypes.cc index a9d621859..166bfabff 100644 --- a/dcmsr/libsrc/dsrtypes.cc +++ b/dcmsr/libsrc/dsrtypes.cc @@ -1178,13 +1178,17 @@ OFCondition DSRTypes::getAndCheckElementFromDataset(DcmItem &dataset, DcmStack stack; const DcmTagKey tagKey = delem.getTag(); OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); - if (result.good() && stack.top()->isElement()) + if (result.good()) { - /* copy object from search stack */ - result = delem.copyFrom(*stack.top()); - /* we need a reference to the original element in order to determine the SpecificCharacterSet */ - if (!checkElementValue(OFstatic_cast(DcmElement *, stack.top()), tagKey, vm, type, result, moduleName, acceptViolation)) - result = SR_EC_InvalidValue; + if (stack.top()->isElement()) + { + /* copy object from search stack */ + result = delem.copyFrom(*stack.top()); + /* we need a reference to the original element in order to determine the SpecificCharacterSet */ + if (!checkElementValue(OFstatic_cast(DcmElement *, stack.top()), tagKey, vm, type, result, moduleName, acceptViolation)) + result = SR_EC_InvalidValue; + } else + result = EC_CorruptedData; } /* the element could not be found in the dataset */ else if (!checkElementValue(delem, vm, type, result, moduleName, acceptViolation)) @@ -1203,13 +1207,17 @@ OFCondition DSRTypes::getAndCheckStringValueFromDataset(DcmItem &dataset, { DcmStack stack; OFCondition result = dataset.search(tagKey, stack, ESM_fromHere, OFFalse /*searchIntoSub*/); - if (result.good() && stack.top()->isElement()) + if (result.good()) { - DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); - /* we need a reference to the original element in order to determine the SpecificCharacterSet */ - if (!checkElementValue(delem, tagKey, vm, type, result, moduleName, acceptViolation)) - result = SR_EC_InvalidValue; - delem->getOFString(stringValue, 0); + if (stack.top()->isElement()) + { + DcmElement *delem = OFstatic_cast(DcmElement *, stack.top()); + /* we need a reference to the original element in order to determine the SpecificCharacterSet */ + if (!checkElementValue(delem, tagKey, vm, type, result, moduleName, acceptViolation)) + result = SR_EC_InvalidValue; + delem->getOFString(stringValue, 0); + } else + result = EC_CorruptedData; } else { if ((type == "1") || (type == "2")) { -- 2.44.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor