00_MQTT2_SERVER.pm: ignore zero-length password (Forum #141992)

git-svn-id: https://svn.fhem.de/fhem/trunk@30088 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2025-07-02 14:15:56 +00:00
parent 550f9f63b0
commit b86a8ec8c1

View File

@@ -699,6 +699,7 @@ sub
MQTT2_SERVER_getStr($$$) MQTT2_SERVER_getStr($$$)
{ {
my ($hash, $in, $off) = @_; my ($hash, $in, $off) = @_;
return ("", "") if(length($in) < $off+2);
my $l = unpack("n", substr($in, $off, 2)); my $l = unpack("n", substr($in, $off, 2));
my $r = substr($in, $off+2, $l); my $r = substr($in, $off+2, $l);
$hash->{stringError} = 1 if(index($r, "\0") >= 0); $hash->{stringError} = 1 if(index($r, "\0") >= 0);