You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kamailio/debian/patches/upstream/0004-topoh-safety-check-to-...

32 lines
827 B

From 4180f5bf64b6b4338f99ba0eb7d2146ef86c088e Mon Sep 17 00:00:00 2001
From: Minh Phan <pqminh@gmail.com>
Date: Fri, 27 Jan 2017 09:06:08 +0100
Subject: [PATCH] topoh: safety check to avoid crash when there is no via
header
- based on GH #952
(cherry picked from commit 2367fb52aa94bd06fcbadce7f9ecccdcf6e36c83)
---
modules/topoh/th_msg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/topoh/th_msg.c b/modules/topoh/th_msg.c
index 40a956e81..a070c2705 100644
--- a/modules/topoh/th_msg.c
+++ b/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
--
2.11.0