mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-17 04:51:03 +08:00
Access QoS field after validating topic length
PUBLISHED_FROM=6f2d9849d75ca1ec2b6dade11ccad8d0c5d4b3bd
This commit is contained in:
parent
97d733e129
commit
f857f6394f
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user