[sr-dev] git:5.2:77eebed8: topoh: check returned pointer when decoding call-id

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 11 10:20:30 CET 2019


Module: kamailio
Branch: 5.2
Commit: 77eebed8be1930fdb03f4fce0a1caac1bd45c583
URL: https://github.com/kamailio/kamailio/commit/77eebed8be1930fdb03f4fce0a1caac1bd45c583

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-03-11T10:19:54+01:00

topoh: check returned pointer when decoding call-id

(cherry picked from commit b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577)

---

Modified: src/modules/topoh/th_msg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/77eebed8be1930fdb03f4fce0a1caac1bd45c583.diff
Patch: https://github.com/kamailio/kamailio/commit/77eebed8be1930fdb03f4fce0a1caac1bd45c583.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