Bug #1143
closedData corruption in convertToUTF8() with oficonv in pass-through mode
100%
Description
The oficonv module offers a pass-through mode in which the libary will simply copy input to output during a character set conversion if input and output encoding are the same. This behaviour is currently disabled by default, but was enabled by default in DCMTK 3.6.8 release. It can be enabled by compiling with the macro DCMTK_ENABLE_ICONV_PASSTHROUGH.
In this mode, the conversion of a DICOM attribute with more than 1024 characters will result in data corruption if the dataset is already encoded in UTF-8 and DcmDataset::convertToUTF8() called:
The first 1024 characters are correct, but afterwards the string is corrupted (the first 1024 characters are repeated again and again; the other characters are lost).
The attached sample program demonstrates the issue. When compiling the the current DCMTK testing or master branch, the test will pass if DCMTK is compiled without DCMTK_ENABLE_ICONV_PASSTHROUGH, and fail otherwise.
Reported 2024-11-19 by DCMTK forum user cschreib, https://forum.dcmtk.org/viewtopic.php?t=5424
Files
Updated by Marco Eichelberg 8 months ago
- % Done changed from 0 to 100
- Estimated time set to 1:00 h
Closed by commit #ae6352657.