From 67a864dd70dca3a4533fe271622b1a044edc4503 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 17 Sep 2010 07:33:53 +0200 Subject: [PATCH] fix parsing of "challenge" regarding NUL byte --- server/rcon.pl | 2 +- server/rcon2irc/rcon2irc.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.2