From ae635265741edf2c1231944c2a933b81e86b6c87 Mon Sep 17 00:00:00 2001 From: Marco Eichelberg Date: Tue, 31 Dec 2024 08:47:12 +0100 Subject: [PATCH] Fixed data corruption in iconv passthrough mode. 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. --- oficonv/libsrc/citrus_iconv_none.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oficonv/libsrc/citrus_iconv_none.c b/oficonv/libsrc/citrus_iconv_none.c index ee1050d4e3..6974ce5d13 100644 --- a/oficonv/libsrc/citrus_iconv_none.c +++ b/oficonv/libsrc/citrus_iconv_none.c @@ -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)