Module: kamailio
Branch: master
Commit: 2367fb52aa94bd06fcbadce7f9ecccdcf6e36c83
URL: 
https://github.com/kamailio/kamailio/commit/2367fb52aa94bd06fcbadce7f9ecccdcf6e36c83

Author: Minh Phan <pqm...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2017-01-27T09:06:08+01:00

topoh: safety check to avoid crash when there is no via header

- based on GH #952

---

Modified: src/modules/topoh/th_msg.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2367fb52aa94bd06fcbadce7f9ecccdcf6e36c83.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2367fb52aa94bd06fcbadce7f9ecccdcf6e36c83.patch

---

diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c
index 09f4d04..a320c4a 100644
--- a/src/modules/topoh/th_msg.c
+++ b/src/modules/topoh/th_msg.c
@@ -954,6 +954,10 @@ int th_add_hdr_cookie(sip_msg_t *msg)
 struct via_param *th_get_via_cookie(sip_msg_t *msg, struct via_body *via)
 {
        struct via_param *p;
+
+       if (!via) {
+               return NULL;
+       }
        for(p=via->param_lst; p; p=p->next)
        {
                if(p->name.len==th_cookie_name.len


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to