[sr-dev] git:master:2c4ed592: core: safety check for append_branch() when called with no uri and no msg
Daniel-Constantin Mierla
miconda at gmail.com
Thu Feb 5 11:29:38 CET 2015
Module: kamailio
Branch: master
Commit: 2c4ed5922a2322f3b5059f6264884acfb5dec97f
URL: https://github.com/kamailio/kamailio/commit/2c4ed5922a2322f3b5059f6264884acfb5dec97f
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-02-05T11:29:26+01:00
core: safety check for append_branch() when called with no uri and no 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
---
Modified: dset.c
---
Diff: https://github.com/kamailio/kamailio/commit/2c4ed5922a2322f3b5059f6264884acfb5dec97f.diff
Patch: https://github.com/kamailio/kamailio/commit/2c4ed5922a2322f3b5059f6264884acfb5dec97f.patch
---
diff --git a/dset.c b/dset.c
index 7ccdf53..2fb3b70 100644
--- a/dset.c
+++ b/dset.c
@@ -352,6 +352,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
More information about the sr-dev
mailing list