bluetooth: Fix incorrect index check with PA_ELEMENTSOF

The equality case should also be considered an index-out-of-range case.
This commit is contained in:
Mikel Astiz 2013-02-14 12:50:11 +01:00 committed by Tanu Kaskinen
parent 930654a3af
commit b84c293ff3

View file

@ -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];