[sr-dev] git:master:b5ce9d8f: topoh: check returned pointer when decoding call-id

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 11 09:58:56 CET 2019


Module: kamailio
Branch: master
Commit: b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577
URL: https://github.com/kamailio/kamailio/commit/b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-03-11T09:58:42+01:00

topoh: check returned pointer when decoding call-id

---

Modified: src/modules/topoh/th_msg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577.diff
Patch: https://github.com/kamailio/kamailio/commit/b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577.patch

---

diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c
index e03b3653fa..6849520540 100644
--- a/src/modules/topoh/th_msg.c
+++ b/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);




More information about the sr-dev mailing list