فهرست منبع

topoh: check returned pointer when decoding call-id

(cherry picked from commit b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577)
(cherry picked from commit 77eebed8be1930fdb03f4fce0a1caac1bd45c583)
(cherry picked from commit c14bb3cb8ff6ba7df81f1955f629ee169da0edd6)
Daniel-Constantin Mierla 6 سال پیش
والد
کامیت
0c2054114b
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      src/modules/topoh/th_msg.c

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

@@ -541,6 +541,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);