From: Mikel Astiz Date: Thu, 14 Feb 2013 11:50:11 +0000 (+0100) Subject: bluetooth: Fix incorrect index check with PA_ELEMENTSOF X-Git-Url: https://code.delx.au/pulseaudio/commitdiff_plain/b84c293ff37bcf9df9cab0b8267e3f141a21dc42 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 98e795cc..8fa1631a 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];