Commit b4251bb4 authored by Pekka Pessi's avatar Pekka Pessi

sip: do not accept empty URIs (<>) in From, To, and other headers expecting name-addr format

darcs-hash:20070601191723-65a35-189040b7dde8d77c9fe4ce0288e75c8776cd5663.gz
parent 0ad15100
......@@ -718,6 +718,9 @@ issize_t sip_name_addr_d(su_home_t *home,
* it is like "Contact: url:foo,sip:bar,sip:zunk"
*/
c = *s; *s = '\0'; /* terminate temporarily */
/* Do not accept an empty URL */
if (addr_spec[0] == '\0')
return -1;
if (url_d(return_url, addr_spec) == -1)
return -1;
*s = c; /* return terminator */
......
......@@ -405,6 +405,8 @@ int test_basic(void)
TEST_1(!sip_from_create(home, (void *)"sip:joe@[baa"));
TEST_1(!sip_from_make(home, (void *)"tester <>;tag=fasjfuios"));
TEST_1(f = sip_from_make(home, (void *)"sip:joe@bar (foo)"));
su_free(home, f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment