Browse Source

topoh: check returned pointer when decoding call-id

Daniel-Constantin Mierla 6 years ago
parent
commit
b5ce9d8f9a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/modules/topoh/th_msg.c

+ 4 - 0
src/modules/topoh/th_msg.c

@@ -559,6 +559,10 @@ int th_unmask_callid_str(str *icallid, str *ocallid)
 	}
 	out.s = th_mask_decode(icallid->s, icallid->len,
 					&th_callid_prefix, 0, &out.len);
+	if(out.s == NULL) {
+		LM_ERR("failed to decode call-id\n");
+		return -2;
+	}
 	if(out.len>=TH_CALLID_SIZE) {
 		pkg_free(out.s);
 		LM_ERR("not enough callid buf size (needed %d)\n", out.len);