Module: kamailio Branch: master Commit: 93b297e16134b0e74cf83e3604da01355a52e700 URL: https://github.com/kamailio/kamailio/commit/93b297e16134b0e74cf83e3604da0135...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-07-24T12:43:26+02:00
siptrace: check if To header is parsed and available
- it is accessed and can lead to crash if not prepared - reported by GH #263
---
Modified: modules/siptrace/siptrace.c
---
Diff: https://github.com/kamailio/kamailio/commit/93b297e16134b0e74cf83e3604da0135... Patch: https://github.com/kamailio/kamailio/commit/93b297e16134b0e74cf83e3604da0135...
---
diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c index 4ee8f00..df6ceff 100644 --- a/modules/siptrace/siptrace.c +++ b/modules/siptrace/siptrace.c @@ -535,6 +535,11 @@ static int sip_trace_prepare(sip_msg_t *msg) goto error; }
+ if(parse_to_header(msg)==-1 || msg->to==NULL || get_to(msg)==NULL) { + LM_ERR("cannot parse To header\n"); + goto error; + } + if(parse_headers(msg, HDR_CALLID_F, 0)!=0 || msg->callid==NULL || msg->callid->body.s==NULL) { LM_ERR("cannot parse call-id\n");