[pulseaudio-discuss] [PATCH v0 2/2] bluetooth: Fix incorrect index check with PA_ELEMENTSOF

Tanu Kaskinen tanuk at iki.fi
Thu Feb 14 04:49:36 PST 2013


On Thu, 2013-02-14 at 12:50 +0100, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> 
> The equality case should also be considered an index-out-of-range case.
> ---
>  src/modules/bluetooth/bluetooth-util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
> index 8ca4000..0af9dec 100644
> --- a/src/modules/bluetooth/bluetooth-util.c
> +++ b/src/modules/bluetooth/bluetooth-util.c
> @@ -1806,7 +1806,7 @@ const char*pa_bluetooth_get_form_factor(uint32_t class) {
>      if (((class >> 8) & 31) != 4)
>          return NULL;
>  
> -    if ((i = (class >> 2) & 63) > PA_ELEMENTSOF(table))
> +    if ((i = (class >> 2) & 63) >= PA_ELEMENTSOF(table))
>          r =  NULL;
>      else
>          r = table[i];

Thanks, I applied this one.

-- 
Tanu



More information about the pulseaudio-discuss mailing list