[PATCH] Prevent corruption of SIP messages in logs

Dan Scott dscott at laurentian.ca
Wed Jun 15 15:17:31 EDT 2011


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 <dscott at laurentian.ca>
---
 Sip.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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);
-- 
1.5.6.5


--pWyiEgJYm5f9v55/--


More information about the Open-ils-dev mailing list