From: Lucas De Marchi Date: Wed, 22 May 2013 21:28:38 +0000 (-0300) Subject: common: Fix parsing SS control string X-Git-Tag: 1.13~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53a0fa8c7cd5c108613a09004c906c2cc7420b86;p=platform%2Fupstream%2Fofono.git common: Fix parsing SS control string 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. --- diff --git a/src/common.c b/src/common.c index 94d70dd..17d1d58 100644 --- a/src/common.c +++ b/src/common.c @@ -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] == '*')