common: Fix parsing SS control string
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 22 May 2013 21:28:38 +0000 (18:28 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 23 May 2013 02:40:19 +0000 (21:40 -0500)
It's not possible to be both greater than '9' and less than '0'. This
would lead to accepting things like "#$33#" as activation and "*$33#" as
deactivation, even though the string makes no sense.

src/common.c

index 94d70dd..17d1d58 100644 (file)
@@ -554,7 +554,7 @@ gboolean parse_ss_control_string(char *str, int *ss_type,
 
        cur = 1;
 
-       if (str[1] != '*' && str[1] != '#' && str[1] > '9' && str[1] < '0')
+       if (str[1] != '*' && str[1] != '#' && (str[1] > '9' || str[1] < '0'))
                goto out;
 
        if (str[0] == '#' && str[1] == '*')