Changeset 3301


Ignore:
Timestamp:
Aug 31, 2010 4:46:13 PM (9 years ago)
Author:
bennylp
Message:

Fixed #1116 (Bug in regenerating elements of some headers when incoming request contains escaped characters (thanks Ferguen Adel for the report)):

  • Fixed the printing part of Via "branch" parameter and To/From? "tag" parameter, since these parameters are important for transaction/dialog identification
  • Note that if the escaping sequence describes a character that otherwise is a valid token, that token would still be printed unescaped, hence the problem would still persist. But sender really shouldn't send this kind of escaped sequence as it really is asking for trouble.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    r3241 r3301  
    2727#include <pj/pool.h> 
    2828#include <pj/assert.h> 
     29#include <pjlib-util/string.h> 
    2930 
    3031PJ_DEF_DATA(const pjsip_method) pjsip_invite_method = 
     
    15251526    buf += printed; 
    15261527 
    1527     copy_advance_pair(buf, ";tag=", 5, hdr->tag); 
     1528    copy_advance_pair_escape(buf, ";tag=", 5, hdr->tag, 
     1529                             pc->pjsip_TOKEN_SPEC); 
    15281530 
    15291531    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,  
     
    20502052 
    20512053    copy_advance_pair(buf, ";received=", 10, hdr->recvd_param); 
    2052     copy_advance_pair(buf, ";branch=", 8, hdr->branch_param); 
     2054    copy_advance_pair_escape(buf, ";branch=", 8, hdr->branch_param, 
     2055                             pc->pjsip_TOKEN_SPEC); 
    20532056     
    20542057    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,  
Note: See TracChangeset for help on using the changeset viewer.