From b5ce9d8f9a1b1fd705ad4b533e7cbc9166a3f577 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 11 Mar 2019 09:57:57 +0100 Subject: [PATCH] topoh: check returned pointer when decoding call-id --- src/modules/topoh/th_msg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c index e03b3653faf..6849520540b 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);