From b84c293ff37bcf9df9cab0b8267e3f141a21dc42 Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Thu, 14 Feb 2013 12:50:11 +0100 Subject: [PATCH] bluetooth: Fix incorrect index check with PA_ELEMENTSOF 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 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]; -- 2.39.2