diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-10-26 09:30:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-10-26 09:30:37 +0000 |
commit | bfaf62527daee7c3e7200a77437bd99b037232b9 (patch) | |
tree | b5a2b8d3ca7a7cb4daee0b7c0e644f1f1eac53bc /pjsip/src | |
parent | 7b547d0f502880de7d8899239110972b90da21cf (diff) |
Misc (re #1559): Require name-addr to have the quote if display name is given. Previously an URI like this will be accepted: "301 301" sip:301@host
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4288 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r-- | pjsip/src/pjsip/sip_parser.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c index ccdf5d35..56ce484c 100644 --- a/pjsip/src/pjsip/sip_parser.c +++ b/pjsip/src/pjsip/sip_parser.c @@ -1522,8 +1522,15 @@ static pjsip_name_addr *int_parse_name_addr( pj_scanner *scanner, /* Get the SIP-URL */ has_bracket = (*scanner->curptr == '<'); - if (has_bracket) + if (has_bracket) { pj_scan_get_char(scanner); + } else if (name_addr->display.slen) { + /* Must have bracket now (2012-10-26). + * Allowing (invalid) name-addr to pass URI verification will + * cause us to send invalid URI to the wire. + */ + PJ_THROW( PJSIP_SYN_ERR_EXCEPTION); + } name_addr->uri = int_parse_uri( scanner, pool, PJ_TRUE ); if (has_bracket) { if (pj_scan_get_char(scanner) != '>') |