Module: kamailio
Branch: master
Commit: 4e760394b63ab0bf3ca6deb1d527c96f800a834d
URL: https://github.com/kamailio/kamailio/commit/4e760394b63ab0bf3ca6deb1d527c96…
Author: Valentin Christoph <valentin(a)kapsch.net>
Committer: Valentin Christoph <valentin(a)kapsch.net>
Date: 2017-08-11T14:43:36+02:00
ims_auth: fixed rare core dump, due to null ptr check
The ims_auth module reads the value from the Content-Length header
of a REGISTER request, before decoding the message body.
Due to a missing null pointer check, reading this value leads
to core dump in case the Content-Length header is missing.
---
Modified: src/modules/ims_auth/utils.c
---
Diff: https://github.com/kamailio/kamailio/commit/4e760394b63ab0bf3ca6deb1d527c96…
Patch: https://github.com/kamailio/kamailio/commit/4e760394b63ab0bf3ca6deb1d527c96…
---
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);
Module: kamailio
Branch: master
Commit: 1ec6964249dc5db4bd69c612b626466cae896c41
URL: https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-11T15:37:33+02:00
core: main.c - updates for shm unlock in shutdown cleanup
- test if shm was initialized before global unlock
---
Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466…
Patch: https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466…
---
diff --git a/src/main.c b/src/main.c
index a98a35693f..b65b0020ca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -518,10 +518,11 @@ void cleanup(int show_status)
/*clean-up*/
#ifndef SHM_SAFE_MALLOC
- if (_shm_lock)
- shm_unlock(); /* hack: force-unlock the shared memory lock in case
- some process crashed and let it locked; this will
- allow an almost gracious shutdown */
+ if(shm_initialized()) {
+ /* force-unlock the shared memory lock in case some process crashed
+ * and let it locked; this will allow an almost gracious shutdown */
+ shm_global_unlock();
+ }
#endif
destroy_rpcs();
destroy_modules();