aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-03 19:30:02 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-03 19:30:02 +0000
commitef4d7c392240c48c586898649e2ca1134bc227ad (patch)
treec741e8275ea090676985c92bfafd1286fa1b7588
parent5213a16f36b848fcf895701cabcffff5f9da9689 (diff)
Copy the From header into a variable so that pedantic SIP handling does not try to mess with a NULL pointer. (AST-2008-008)
(closes issue #12607) Reported by: hooi git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@120109 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index afd0c2211..47d5a9541 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6831,12 +6831,14 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
return -1;
}
from += 4;
+ if (pedanticsipchecking) {
+ ast_uri_decode(from);
+ }
} else
from = NULL;
if (pedanticsipchecking) {
ast_uri_decode(uri);
- ast_uri_decode(from);
}
/* Get the target domain first and user */
@@ -7261,11 +7263,10 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
while(*t && (*t > 32) && (*t != ';'))
t++;
*t = '\0';
- of = get_header(req, "From");
- if (pedanticsipchecking)
- ast_uri_decode(of);
- ast_copy_string(from, of, sizeof(from));
+ ast_copy_string(from, get_header(req, "From"), sizeof(from));
+ if (pedanticsipchecking)
+ ast_uri_decode(from);
memset(calleridname,0,sizeof(calleridname));
get_calleridname(from, calleridname, sizeof(calleridname));