Bug in int_parse_status_line (sip_parser.c)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have found a bug in function int_parse_status_line in file 
sip_parser.c. I was trying to use attended call transfer and trace 
status of the transfer via event subscription (pjsua-lib's 
on_call_transfer_status). But with each client I tested I was getting 
"Warning: received NOTIFY with invalid message/sipfrag content", even 
with pjsua. After few hours of debugging I found out the bug is in 
int_parse_status_line function. Suppose NOTIFY message "SIP/2.0 200 OK". 
On line 1570

     parse_sip_version(scanner);

would eat "SIP/2.0" from the scanner buffer. Then

     pj_scan_get( scanner, &pconst.pjsip_DIGIT_SPEC, &token);

throws an exception because the scanner->currptr points to the 
whitespace in front of status code "200". I solved the problem by adding 
pj_scan_skip_whitespace:

     parse_sip_version(scanner);
     pj_scan_skip_whitespace(scanner);
     pj_scan_get( scanner, &pconst.pjsip_DIGIT_SPEC, &token);

- Vali



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux