Browse code

topoh: improve checks for contact header processing

(cherry picked from commit 101670ac2c120cf0008a860b6a766aaa529e578d)

Henning Westerholt authored on 25/02/2019 15:45:42 • Henning Westerholt committed on 03/04/2019 21:25:03
Showing 1 changed files
... ...
@@ -267,6 +267,11 @@ int th_mask_contact(sip_msg_t *msg)
267 267
 	}
268 268
 
269 269
 	c = ((contact_body_t*)msg->contact->parsed)->contacts;
270
+	if(c == NULL)
271
+	{
272
+		LM_ERR("invalid contact header\n");
273
+		return -1;
274
+	}
270 275
 	in = c->uri;
271 276
 
272 277
 	out.s = th_mask_encode(in.s, in.len, &th_uri_prefix, &out.len);