diff --git a/FHEM/00_FBAHA.pm b/FHEM/00_FBAHA.pm index 83dc8c6ac..404e28f9a 100755 --- a/FHEM/00_FBAHA.pm +++ b/FHEM/00_FBAHA.pm @@ -261,6 +261,11 @@ FBAHA_Read($@) my $msg; while(length($data) >= 16) { my $len = hex(substr($data, 4,4))*2; + if($len < 16 || $len > 10240) { # Out of Sync + Log 1, "FBAHA: resetting buffer as we are out of sync ($len)"; + $hash->{PARTIAL} = ""; + return ""; + } last if($len > length($data)); $msg = substr($data, 0, $len); $data = substr($data, $len);