From: Ruben Kerkhof Date: Sat, 28 Nov 2015 17:59:17 +0000 (+0100) Subject: mqtt: fix an out-of-bounds write X-Git-Tag: collectd-5.6.0~562^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=db5881cda68a542bbdb6692036b89879edb5c7c9;p=collectd.git mqtt: fix an out-of-bounds write CID 37990 --- 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.");