simple_recode: fix heap buffer overflow

This commit is contained in:
Tim Rühsen 2026-06-04 11:10:43 +02:00
parent 1024386831
commit 6a6de7add2
No known key found for this signature in database
GPG Key ID: 08302DB6A2670428

View File

@ -76,6 +76,9 @@ char *simple_recode(const iconv_t handle, const char *str)
if (err != (size_t) -1)
break; /* success */
if (outbytes_remaining == 0)
errno = E2BIG;
switch (errno) {
case EINVAL: /* incomplete multibyte sequence */
case EILSEQ: /* invalid multibyte sequence */