From db5881cda68a542bbdb6692036b89879edb5c7c9 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 28 Nov 2015 18:59:17 +0100 Subject: [PATCH] mqtt: fix an out-of-bounds write CID 37990 --- src/mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mqtt.c b/src/mqtt.c index 7003fcc6..d6bcdce7 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -728,7 +728,7 @@ static int mqtt_config_subscriber (oconfig_item_t *ci) ERROR ("mqtt plugin: Unknown config option: %s", child->key); } - tmp = realloc (subscribers, sizeof (*subscribers) * subscribers_num); + tmp = realloc (subscribers, sizeof (*subscribers) * (subscribers_num + 1) ); if (tmp == NULL) { ERROR ("mqtt plugin: realloc failed."); -- 2.11.0