From 39c0aaa28789e13ff55082307e565925b1a14fe0 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 15 Jun 2011 15:17:31 -0400 Subject: [PATCH] Prevent corruption of SIP messages in logs Non-ASCII characters were not being decoded before being written to the logs, thus resulting in heinous corruption in the logs. decode_utf8() is our friend. Signed-off-by: Dan Scott Signed-off-by: Thomas Berezansky --- Sip.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sip.pm b/Sip.pm index 065e7ff..1e57916 100644 --- a/Sip.pm +++ b/Sip.pm @@ -167,7 +167,7 @@ sub read_SIP_packet { { # adapted from http://perldoc.perl.org/5.8.8/functions/readline.html for ( my $tries = 1 ; $tries <= 3 ; $tries++ ) { undef $!; - $record = readline($fh); + $record = decode_utf8(readline($fh)); if ( defined($record) ) { while ( chomp($record) ) { 1; } $len1 = length($record); -- 2.11.0