Module: kamailio
Branch: master
Commit: 125db2c3650843aae2927a4625e3d42a755fa309
URL:
https://github.com/kamailio/kamailio/commit/125db2c3650843aae2927a4625e3d42…
Author: ng-voice GmbH <info(a)ng-voice.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-08-11T15:54:28+02:00
Merge pull request #1213 from christoph-v/ims_get_body_coredump
ims_auth: fixed rare core dump, due to null ptr check
---
Modified: src/modules/ims_auth/utils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/125db2c3650843aae2927a4625e3d42…
Patch:
https://github.com/kamailio/kamailio/commit/125db2c3650843aae2927a4625e3d42…
---
diff --git a/src/modules/ims_auth/utils.c b/src/modules/ims_auth/utils.c
index 2e40cf8c46..94d02e3fe7 100644
--- a/src/modules/ims_auth/utils.c
+++ b/src/modules/ims_auth/utils.c
@@ -204,7 +204,9 @@ str ims_get_body(struct sip_msg * msg)
LM_DBG("Error parsing until header Content-Length: \n");
return x;
}
- x.len = (int)(long)msg->content_length->parsed;
+ if (msg->content_length)
+ // Content-Length header might be missing
+ x.len = (int)(long)msg->content_length->parsed;
if (x.len>0)
x.s = get_body(msg);