Bug 2653 Protect against sending End of Message in Text
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 23 Feb 2010 11:12:32 +0000 (11:12 +0000)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 7 Apr 2010 10:54:18 +0000 (06:54 -0400)
Remove any carriage returns in text data as they will be
interpreted as end of message by clients and cause communication failure

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/SIP/Sip.pm

index 558a1d4..f176516 100644 (file)
@@ -65,6 +65,8 @@ sub add_field {
               $field_id);
                $value = '';
     }
+    $value=~s/\r/ /g; # CR terminates a sip message
+                      # Protect against them in sip text fields
 
     # Replace any occurences of the field delimiter in the
     # field value with the HTML character entity