Skip to content

Commit

Permalink
core: safety check for append_branch() when called with no uri and no…
Browse files Browse the repository at this point in the history
… msg

- uri or msg parameter must be given, otherwise the new address cannot
  be set
- get_redirects() from uac_redirect can execute this function with both
  parameters invalid in case of invalid contact, reported by Javi
  Gallart

(cherry picked from commit 2c4ed59)
(cherry picked from commit a90e733)
  • Loading branch information
miconda committed Feb 5, 2015
1 parent 20477e7 commit 75e862d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dset.c
Expand Up @@ -341,6 +341,11 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,

/* if not parameterized, take current uri */
if (uri==0 || uri->len==0 || uri->s==0) {
if(msg==NULL) {
LM_ERR("no new uri and no msg to take r-uri\n");
ser_error = E_INVALID_PARAMS;
return -1;
}
if (msg->new_uri.s)
luri = msg->new_uri;
else
Expand Down

0 comments on commit 75e862d

Please sign in to comment.