shithub: sox

Download patch

ref: 60ba6bbb2b74bded48d060267dde25cb1adc1c3c
parent: 5d6ea3f510ab2c5ace71beaa9215f08e5a4b4046
author: Ulrich Klauer <ulrich@chirlu.de>
date: Fri Jan 6 19:03:38 EST 2012

remix: stricter syntax checking

The remix effect would allow usage like "remix foo,3-bar baz", with
funny results. Check that sscanf() actually found a number before
proceeding.

--- a/src/remix.c
+++ b/src/remix.c
@@ -39,7 +39,7 @@
   else { \
     SEP = (SEPARATORS)[strlen(SEPARATORS) - 1]; \
     n = sscanf(text, SCAN"%c", &VAR, &SEP); \
-    if (VAR < MIN || (n == 2 && !strchr(SEPARATORS, SEP))) \
+    if (n == 0 || VAR < MIN || (n == 2 && !strchr(SEPARATORS, SEP))) \
       return lsx_usage(effp); \
     text = end? end + 1 : text + strlen(text); \
   } \