Received: from eggs.gnu.org ([2001:4830:134:3::10]:53302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1MzV-0001aI-5A for qemu-devel@nongnu.org; Tue, 24 Nov 2015 18:27:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1MzR-0000RH-VU for qemu-devel@nongnu.org; Tue, 24 Nov 2015 18:27:17 -0500 From: John Snow Date: Tue, 24 Nov 2015 18:27:11 -0500 Message-Id: <1448407631-9405-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [trivial for-2.6] util/id: fully allocate names table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, jcody@redhat.com, John Snow Trivial: this array should be allocated to have ID_MAX entries always. Otherwise if someone were to forget to expand this table, the assertion in the id generator won't actually trigger; it will read junk data. Signed-off-by: John Snow --- util/id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/id.c b/util/id.c index bcc64d8..b7ca4d2 100644 --- a/util/id.c +++ b/util/id.c @@ -29,7 +29,7 @@ bool id_wellformed(const char *id) #define ID_SPECIAL_CHAR '#' -static const char *const id_subsys_str[] = { +static const char *const id_subsys_str[ID_MAX] = { [ID_QDEV] = "qdev", [ID_BLOCK] = "block", }; -- 2.4.3