mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
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:
parent
189cb008d5
commit
56be9a6d53
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user