Commit f857f639 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Access QoS field after validating topic length

PUBLISHED_FROM=6f2d9849d75ca1ec2b6dade11ccad8d0c5d4b3bd
parent 97d733e1
...@@ -10263,9 +10263,9 @@ int mg_mqtt_next_subscribe_topic(struct mg_mqtt_message *msg, ...@@ -10263,9 +10263,9 @@ int mg_mqtt_next_subscribe_topic(struct mg_mqtt_message *msg,
topic->len = buf[0] << 8 | buf[1]; topic->len = buf[0] << 8 | buf[1];
topic->p = (char *) buf + 2; topic->p = (char *) buf + 2;
*qos = buf[2 + topic->len];
new_pos = pos + 2 + topic->len + 1; new_pos = pos + 2 + topic->len + 1;
if ((size_t) new_pos > msg->payload.len) return -1; if ((size_t) new_pos > msg->payload.len) return -1;
*qos = buf[2 + topic->len];
return new_pos; return new_pos;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment