Browse code

topoh: check returned pointer when decoding call-id

(cherry picked from commit b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577)

Daniel-Constantin Mierla authored on 11/03/2019 08:57:57
Showing 1 changed files
... ...
@@ -559,6 +559,10 @@ int th_unmask_callid_str(str *icallid, str *ocallid)
559 559
 	}
560 560
 	out.s = th_mask_decode(icallid->s, icallid->len,
561 561
 					&th_callid_prefix, 0, &out.len);
562
+	if(out.s == NULL) {
563
+		LM_ERR("failed to decode call-id\n");
564
+		return -2;
565
+	}
562 566
 	if(out.len>=TH_CALLID_SIZE) {
563 567
 		pkg_free(out.s);
564 568
 		LM_ERR("not enough callid buf size (needed %d)\n", out.len);