Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] common: Fix parsing SS control string
Date: Wed, 22 May 2013 21:42:13 -0500	[thread overview]
Message-ID: <519D8205.80000@gmail.com> (raw)
In-Reply-To: <1369258118-6331-1-git-send-email-lucas.demarchi@intel.com>

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

Hi Lucas,

On 05/22/2013 04:28 PM, Lucas De Marchi wrote:
> 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 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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'))

Funny how it is hiding in plain sight and nobody has found it in over 4 
years.  And I think you just got an award for finding the oldest bug :P

Patch has been applied, thanks.

>   		goto out;
>
>   	if (str[0] == '#' && str[1] == '*')
>

Regards,
-Denis

      parent reply	other threads:[~2013-05-23  2:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 21:28 [PATCH] common: Fix parsing SS control string Lucas De Marchi
2013-05-22 22:52 ` Lucas De Marchi
2013-05-23  2:42 ` Denis Kenzior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519D8205.80000@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox