Re: [PATCH BlueZ] Fix incorrect use of atoi in maemo6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitriy,

On Thu, Oct 27, 2011, Dmitriy Paliy wrote:
> Use of atoi is incorrect and unsafe in maemo6 telephony and replaced
> by g_ascii_digit_value.
> ---
>  audio/telephony-maemo6.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
> index 5df3235..a546f44 100644
> --- a/audio/telephony-maemo6.c
> +++ b/audio/telephony-maemo6.c
> @@ -823,7 +823,9 @@ static int tonegen_startevent(char tone)
>  		event_tone = DTMF_D;
>  		break;
>  	default:
> -		event_tone = atoi(&tone);
> +		event_tone = g_ascii_digit_value(tone);
> +		if (event_tone < 0)
> +			return -EINVAL;
>  	}
>  
>  	ret = send_method_call(TONEGEN_BUS_NAME, TONEGEN_PATH,

Doesn't compile:

udio/telephony-maemo6.c: In function ‘tonegen_startevent’:
audio/telephony-maemo6.c:827:3: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]


Please fix and resend.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux