WMBus: add packet length check for frame type B

git-svn-id: https://svn.fhem.de/fhem/trunk@17979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
kaihs
2018-12-15 13:59:18 +00:00
parent ec7f8ea814
commit 5115532214

View File

@@ -1913,6 +1913,13 @@ sub decodeLinkLayer($$)
# first contains the header (TL_BLOCK), L field and trailing crc
# L field is included in crc calculation
# each following block contains only data and trailing crc
if (length($self->{msg}) < $self->{lfield}) {
$self->{errormsg} = "message too short, expected " . $self->{lfield} . ", got " . length($self->{msg}) . " bytes";
$self->{errorcode} = ERR_MSG_TOO_SHORT;
return 0;
}
my $length = 129;
if ($self->{lfield} < $length) {
$length = $self->{lfield};