25 lines
737 B
Text
25 lines
737 B
Text
https://marc.info/?l=oss-security&m=167571683504082&w=2
|
|
|
|
Index: src/sphere.c
|
|
--- src/sphere.c.orig
|
|
+++ src/sphere.c
|
|
@@ -63,7 +63,8 @@ static int start_read(sox_format_t * ft)
|
|
return (SOX_EOF);
|
|
}
|
|
|
|
- header_size -= (strlen(buf) + 1);
|
|
+ bytes_read = strlen(buf);
|
|
+ header_size -= bytes_read >= header_size ? header_size : bytes_read + 1;
|
|
|
|
while (strncmp(buf, "end_head", (size_t)8) != 0) {
|
|
if (strncmp(buf, "sample_n_bytes", (size_t)14) == 0)
|
|
@@ -105,7 +106,8 @@ static int start_read(sox_format_t * ft)
|
|
return (SOX_EOF);
|
|
}
|
|
|
|
- header_size -= (strlen(buf) + 1);
|
|
+ bytes_read = strlen(buf);
|
|
+ header_size -= bytes_read >= header_size ? header_size : bytes_read + 1;
|
|
}
|
|
|
|
if (!bytes_per_sample)
|