Explorar o código

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

- based on GH #952
Minh Phan %!s(int64=8) %!d(string=hai) anos
pai
achega
2367fb52aa
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/modules/topoh/th_msg.c

+ 4 - 0
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