diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-08-12 10:55:28 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-08-12 10:55:28 +0000 |
commit | 852a9cac8973aa2baa9047b0daecc30d4b8f21a1 (patch) | |
tree | c7ab235d5c7aaa14c385a4e91867ed5c011973b1 | |
parent | 437f51ec2d2f059047ca00b1d1d847a058c68f16 (diff) |
Ticket #592: URI comparison may crash the application (thanks Pedro Gonçalves for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2205 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_uri.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pjsip/src/pjsip/sip_uri.c b/pjsip/src/pjsip/sip_uri.c index c5bb2c5d..3ff158c5 100644 --- a/pjsip/src/pjsip/sip_uri.c +++ b/pjsip/src/pjsip/sip_uri.c @@ -601,6 +601,10 @@ static int pjsip_name_addr_compare( pjsip_uri_context_e context, { int d; + /* Check that naddr2 is also a name_addr */ + if (naddr1->vptr != naddr2->vptr) + return -1; + /* I'm not sure whether display name is included in the comparison. */ if (pj_strcmp(&naddr1->display, &naddr2->display) != 0) { return -1; @@ -684,6 +688,10 @@ static int other_uri_cmp(pjsip_uri_context_e context, const pjsip_other_uri *uri2) { PJ_UNUSED_ARG(context); + + /* Check that uri2 is also an other_uri */ + if (uri1->vptr != uri2->vptr) + return -1; /* Scheme must match. */ if (pj_stricmp(&uri1->scheme, &uri2->scheme) != 0) { |