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

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

Return to bug 41811