aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/mqtt.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-06-28 22:28:47 +0200
committercbdev <cb@cbcdn.com>2021-06-28 22:28:47 +0200
commit17551fe56c8dc20630811b1726559b00cb911abd (patch)
tree076b024288e7b35d71cd5c76b3d23a1eb8489f15 /backends/mqtt.c
parent9be900acd86e03c73266c552db133562005f5607 (diff)
downloadmidimonster-17551fe56c8dc20630811b1726559b00cb911abd.tar.gz
midimonster-17551fe56c8dc20630811b1726559b00cb911abd.tar.bz2
midimonster-17551fe56c8dc20630811b1726559b00cb911abd.zip
Fix Coverity CIDs 371602, 355843
Diffstat (limited to 'backends/mqtt.c')
-rw-r--r--backends/mqtt.c2
1 files changed, 1 insertions, 1 deletions
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){