shithub: sox

Download patch

ref: 7d3f38007a1eeaf5ab7669aba0d2a7e4d3def57e
parent: d00500075aa840e1149b6fae3700856e3f74f345
author: Chris Bagwell <chris@cnpbagwell.com>
date: Sat Dec 13 07:48:37 EST 2014

Check for minimum size sphere headers

--- a/src/sphere.c
+++ b/src/sphere.c
@@ -47,6 +47,11 @@
 
   /* Determine header size, and allocate a buffer large enough to hold it. */
   sscanf(fldsval, "%lu", &header_size_ul);
+  if (header_size_ul < 16) {
+    lsx_fail_errno(ft, SOX_EHDR, "Error reading Sphere header");
+    return (SOX_EOF);
+  }
+
   buf = lsx_malloc(header_size = header_size_ul);
 
   /* Skip what we have read so far */