Skip to content

Commit d636a9f

Browse files
authored
Fix out-of-bounds read in msg_mime multipart (#347)
CVE-2026-110658
1 parent 138d8a7 commit d636a9f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎libsofia-sip-ua/msg/msg_mime.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ msg_multipart_t *msg_multipart_parse(su_home_t *home,
401401
m = strlen(boundary) - 2, blen = m - 1;
402402

403403
/* Find first delimiter */
404-
if (memcmp(boundary + 2, p, m - 2) == 0)
404+
if (len >= m - 2 && memcmp(boundary + 2, p, m - 2) == 0)
405405
b = p, p = p + m - 2;
406406
else if ((p = memmem(p, len, boundary + 1, m - 1))) {
407407
if (p != pl->pl_data && p[-1] == '\r')

0 commit comments

Comments
 (0)