From: Mikel Astiz Date: Thu, 14 Feb 2013 11:50:11 +0000 (+0100) Subject: bluetooth: Fix incorrect index check with PA_ELEMENTSOF X-Git-Tag: v3.99.1~123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b84c293ff37bcf9df9cab0b8267e3f141a21dc42;p=platform%2Fupstream%2Fpulseaudio.git bluetooth: Fix incorrect index check with PA_ELEMENTSOF The equality case should also be considered an index-out-of-range case. --- diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 98e795c..8fa1631 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];