shithub: sox

Download patch

ref: 9816c805e26c06c855fbfbd0d41b8e7d1bd61e6b
parent: d29ccbd174370fdd9575f8217d8dfc1b919f51f6
author: robs <robs>
date: Fri Oct 26 08:49:22 EDT 2007

fix some buffer overruns

--- a/src/smp.c
+++ b/src/smp.c
@@ -349,9 +349,9 @@
         ft->signal.encoding = SOX_ENCODING_SIGN2;
         ft->signal.channels = 1;
 
-        strcpy(header.Id, SVmagic);
-        strcpy(header.version, SVvers);
-        sprintf(header.comments, "%-*s", COMMENTLEN, "Converted using Sox.");
+        memcpy(header.Id, SVmagic, sizeof(header.Id));
+        memcpy(header.version, SVvers, sizeof(header.version));
+        sprintf(header.comments, "%-*s", COMMENTLEN - 1, "Converted using Sox.");
         sprintf(header.name, "%-*.*s", NAMELEN, NAMELEN, ft->comment);
 
         /* Write file header */