Module: kamailio
Branch: master
Commit: db3b9dbd48f7bb74abf08b0e97bcac15015df719
URL:
https://github.com/kamailio/kamailio/commit/db3b9dbd48f7bb74abf08b0e97bcac1…
Author: Roman Romanchenko <rromanchenko(a)sipwise.com>
Committer: Roman Romanchenko <rromanchenko(a)sipwise.com>
Date: 2018-08-31T12:02:43+03:00
tm: crash on memcpy fix
- in some cases tag is not initialized and lead to crash.
Memory pointer check before writing to added.
---
Modified: src/modules/tm/t_reply.c
---
Diff:
https://github.com/kamailio/kamailio/commit/db3b9dbd48f7bb74abf08b0e97bcac1…
Patch:
https://github.com/kamailio/kamailio/commit/db3b9dbd48f7bb74abf08b0e97bcac1…
---
diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c
index 474851aa7c..f53625e833 100644
--- a/src/modules/tm/t_reply.c
+++ b/src/modules/tm/t_reply.c
@@ -299,6 +299,7 @@ inline static int update_totag_set(struct cell *t, struct sip_msg
*ok)
for (i=t->fwded_totags; i; i=i->next) {
if (i->tag.len==tag->len
+ && i->tag.s
&& memcmp(i->tag.s, tag->s, tag->len) ==0 ){
/* to tag already recorded */
LM_DBG("to-tag retransmission\n");