From: Rudolf Polzer Date: Fri, 17 Sep 2010 05:33:53 +0000 (+0200) Subject: fix parsing of "challenge" regarding NUL byte X-Git-Tag: xonotic-v0.1.0preview~206 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=67a864dd70dca3a4533fe271622b1a044edc4503;p=xonotic%2Fxonotic.git fix parsing of "challenge" regarding NUL byte --- diff --git a/server/rcon.pl b/server/rcon.pl index 80b651a0..45952cb6 100755 --- a/server/rcon.pl +++ b/server/rcon.pl @@ -457,7 +457,7 @@ sub recvchallenge($) if not defined $s; length $s or last; - if($s =~ /^\377\377\377\377challenge (.*)$/s) + if($s =~ /^\377\377\377\377challenge (.*?)(?:$|\0)/s) { return $1; } diff --git a/server/rcon2irc/rcon2irc.pl b/server/rcon2irc/rcon2irc.pl index b5d3c89e..88a98ccc 100755 --- a/server/rcon2irc/rcon2irc.pl +++ b/server/rcon2irc/rcon2irc.pl @@ -514,7 +514,7 @@ sub recvchallenge($) if not defined $s; length $s or last; - if($s =~ /^\377\377\377\377challenge (.*)$/s) + if($s =~ /^\377\377\377\377challenge (.*)(?:$|\0)/s) { return $1; }