From 17551fe56c8dc20630811b1726559b00cb911abd Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 28 Jun 2021 22:28:47 +0200 Subject: Fix Coverity CIDs 371602, 355843 --- backends/mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/mqtt.c') diff --git a/backends/mqtt.c b/backends/mqtt.c index 47042f1..da4bf38 100644 --- a/backends/mqtt.c +++ b/backends/mqtt.c @@ -765,7 +765,7 @@ static int mqtt_handle_publish(instance* inst, uint8_t type, uint8_t* variable_h uint16_t topic_alias = 0; uint32_t property_length = 0; size_t u = data->nchannels, property_offset, payload_offset, payload_length; - size_t topic_length = mqtt_pop_utf8(variable_header, length, &topic); + size_t topic_length = min(mqtt_pop_utf8(variable_header, length, &topic), length); property_offset = payload_offset = topic_length + 2 + ((qos > 0) ? 2 : 0); if(data->mqtt_version == 0x05){ -- cgit v1.2.3