2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

00_MQTT2_SERVER.pm: reject CONNECT with non-zero reserved bits (Forum #119585)

git-svn-id: https://svn.fhem.de/fhem/trunk@23987 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-03-17 16:33:09 +00:00
parent 2614241835
commit 1841c3e1e1

View File

@ -324,6 +324,10 @@ MQTT2_SERVER_Read($@)
####################################
if($cpt eq "CONNECT") {
# V3:MQIsdb V4:MQTT
if(ord($fb) & 0xf) { # lower nibble must be zero
Log3 $sname, 3, "$cname with bogus CONNECT (".ord($fb)."), disconnecting";
return CommandDelete(undef, $cname);
}
($hash->{protoTxt}, $off) = MQTT2_SERVER_getStr($hash, $pl, 0);
$hash->{protoNum} = unpack('C*', substr($pl,$off++,1)); # 3 or 4
$hash->{cflags} = unpack('C*', substr($pl,$off++,1));