View | Details | Raw Unified | Return to bug 41811
Collapse All | Expand All

(-)a/C4/SIP/SIPServer.pm (-3 / +5 lines)
Lines 501-508 sub read_request { Link Here
501
        $raw_length = length $buffer;
501
        $raw_length = length $buffer;
502
        $buffer =~ s/^\s*[^A-z0-9]+//s;
502
        $buffer =~ s/^\s*[^A-z0-9]+//s;
503
503
504
        # Every line must start with a "real" character.  Not whitespace, control chars, etc.
504
        # Remove leading/trailing control characters and whitespace.
505
        $buffer =~ s/[^A-z0-9]+$//s;
505
        # SIP2 messages should be a single printable line; this defensively
506
        # cleans up stray CR/LF or junk from buggy or long-lived client connections.
507
        $buffer =~ s/^[[:cntrl:]\s]+//;
508
        $buffer =~ s/[[:cntrl:]\s]+$//;
506
509
507
        # Same for the end.  Note this catches the problem some clients have sending empty fields at the end, like |||
510
        # Same for the end.  Note this catches the problem some clients have sending empty fields at the end, like |||
508
        $buffer =~ s/\015?\012//g;     # Extra line breaks must die
511
        $buffer =~ s/\015?\012//g;     # Extra line breaks must die
509
- 

Return to bug 41811