sox/CVE-2019-13590.patch
starlet-dx a3b24a76f4 Fix CVE-2019-8354,CVE-2019-8355,CVE-2019-8356,CVE-2019-8357 and CVE-2019-13590
(cherry picked from commit 225d6927a5a1ea8b52d6d8d05fb75271b3db8180)
2025-01-06 14:56:37 +08:00

14 lines
494 B
Diff

--- a/src/sox-fmt.c
+++ b/src/sox-fmt.c
@@ -46,7 +46,9 @@
lsx_readdw(ft, &comments_bytes))
return SOX_EOF;
- if (((headers_bytes + 4) & 7) || headers_bytes < FIXED_HDR + comments_bytes ||
+ if (((headers_bytes + 4) & 7) ||
+ comments_bytes > 0x40000000 || /* max 1 GB */
+ headers_bytes < FIXED_HDR + comments_bytes ||
(num_channels > 65535)) /* Reserve top 16 bits */ {
lsx_fail_errno(ft, SOX_EHDR, "invalid sox file format header");
return SOX_EOF;