Skip to content

Commit 613d948

Browse files
authored
Apply CVE patches from musl 1.2.5 (#24470)
This change applies the 2 security patches listed for musl 1.2.5 on https://musl.libc.org/.
1 parent 6f4d86b commit 613d948

File tree

1 file changed

+5
-1
lines changed
  • system/lib/libc/musl/src/locale

1 file changed

+5
-1
lines changed

system/lib/libc/musl/src/locale/iconv.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
495495
if (c >= 93 || d >= 94) {
496496
c += (0xa1-0x81);
497497
d += 0xa1;
498-
if (c >= 93 || c>=0xc6-0x81 && d>0x52)
498+
if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52)
499499
goto ilseq;
500500
if (d-'A'<26) d = d-'A';
501501
else if (d-'a'<26) d = d-'a'+26;
@@ -538,6 +538,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
538538
if (*outb < k) goto toobig;
539539
memcpy(*out, tmp, k);
540540
} else k = wctomb_utf8(*out, c);
541+
/* This failure condition should be unreachable, but
542+
* is included to prevent decoder bugs from translating
543+
* into advancement outside the output buffer range. */
544+
if (k>4) goto ilseq;
541545
*out += k;
542546
*outb -= k;
543547
break;

0 commit comments

Comments
 (0)