From: parmeet Date: Thu, 10 Jul 2025 20:53:52 +0000 (-0400) Subject: Fix ASAN errors due adding offset to nullptr (#240) X-Git-Tag: archive/raspbian/2.11.3-2+rpi1^2~10^2^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8861a0ef7d0b58543a166071c211b52ee358e9e1;p=utf8proc.git Fix ASAN errors due adding offset to nullptr (#240) * Fix ASAN errors due adding offset to nullptr * Revert "Fix ASAN errors due adding offset to nullptr" This reverts commit b933f42d51e6a8e278e6ce1932e6e027e07d5f51. * make changes compact --- diff --git a/utf8proc.c b/utf8proc.c index a7aff86..87cec94 100644 --- a/utf8proc.c +++ b/utf8proc.c @@ -388,7 +388,7 @@ static utf8proc_ssize_t seqindex_write_char_decomposed(utf8proc_uint16_t seqinde for (; len >= 0; entry++, len--) { utf8proc_int32_t entry_cp = seqindex_decode_entry(&entry); - written += utf8proc_decompose_char(entry_cp, dst+written, + written += utf8proc_decompose_char(entry_cp, dst ? dst+written : dst, (bufsize > written) ? (bufsize - written) : 0, options, last_boundclass); if (written < 0) return UTF8PROC_ERROR_OVERFLOW; @@ -578,7 +578,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom( uc = custom_func(uc, custom_data); /* user-specified custom mapping */ } decomp_result = utf8proc_decompose_char( - uc, buffer + wpos, (bufsize > wpos) ? (bufsize - wpos) : 0, options, + uc, buffer ? buffer+wpos : buffer, (bufsize > wpos) ? (bufsize - wpos) : 0, options, &boundclass ); if (decomp_result < 0) return decomp_result;