Skip to content

Commit

Permalink
Fixed data corruption in iconv passthrough mode.
Browse files Browse the repository at this point in the history
Fixed a data corruption that occured if a string longer than 1024 characters
was run through OFiconv() with source and character set being identical
and the pass-through mode being enabled (i.e. DCMTK compiled with the macro
DCMTK_ENABLE_ICONV_PASSTHROUGH). In this situation, the pointer to the next
unprocessed input character was not updated.

Thanks to DCMTK forum user cschreib for the bug report and test program.

This closes DCMTK issue #1143.
  • Loading branch information
eichelberg committed Dec 31, 2024
1 parent b88017d commit ae63526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oficonv/libsrc/citrus_iconv_none.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ _citrus_iconv_none_iconv_convert(struct _citrus_iconv * ci ,
len = *outbytes;
}
memcpy(*out, *in, len);
in += len;
*in += len;
*inbytes -= len;
out += len;
*out += len;
*outbytes -= len;
*invalids = 0;
if (e2big)
Expand Down

0 comments on commit ae63526

Please sign in to comment.