Module: kamailio
Branch: 4.3
Commit: 8ba3be202f70a90ea88cdaac47fd2a7f9a9ef4f4
URL:
https://github.com/kamailio/kamailio/commit/8ba3be202f70a90ea88cdaac47fd2a7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-24T12:44:51+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
(cherry picked from commit 93b297e16134b0e74cf83e3604da01355a52e700)
---
Modified: modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8ba3be202f70a90ea88cdaac47fd2a7…
Patch:
https://github.com/kamailio/kamailio/commit/8ba3be202f70a90ea88cdaac47fd2a7…
---
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");