GH-517: fix MQTT suback/unsuback accessing non-existent index

This commit is contained in:
Jon Siwek 2019-08-02 11:55:46 -07:00
parent b3884de2e5
commit d2eed166bd
3 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,8 @@
2.6-748 | 2019-08-02 11:55:46 -0700
* GH-517: fix MQTT suback/unsuback accessing non-existent index (Jon Siwek, Corelight)
2.6-747 | 2019-08-02 11:30:52 -0700 2.6-747 | 2019-08-02 11:30:52 -0700
* Fix how Broker/CAF sleep duration options are set (Jon Siwek, Corelight) * Fix how Broker/CAF sleep duration options are set (Jon Siwek, Corelight)

View file

@ -1 +1 @@
2.6-747 2.6-748

View file

@ -302,6 +302,9 @@ event mqtt_suback(c: connection, msg_id: count, granted_qos: count) &priority=5
{ {
set_session(c); set_session(c);
if ( msg_id !in c$mqtt_state$subscribe )
return;
local x = c$mqtt_state$subscribe[msg_id]; local x = c$mqtt_state$subscribe[msg_id];
x$granted_qos_level = granted_qos; x$granted_qos_level = granted_qos;
x$ack = T; x$ack = T;
@ -327,6 +330,9 @@ event mqtt_unsuback(c: connection, msg_id: count) &priority=-5
{ {
set_session(c); set_session(c);
if ( msg_id !in c$mqtt_state$subscribe )
return;
local x = c$mqtt_state$subscribe[msg_id]; local x = c$mqtt_state$subscribe[msg_id];
x$ack = T; x$ack = T;