ソースを参照

tm: crash on memcpy fix

- in some cases tag is not initialized and lead to crash.
  Memory pointer check before writing to added.
Roman Romanchenko 7 年 前
コミット
db3b9dbd48
1 ファイル変更1 行追加0 行削除
  1. 1 0
      src/modules/tm/t_reply.c

+ 1 - 0
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) {
 	for (i=t->fwded_totags; i; i=i->next) {
 		if (i->tag.len==tag->len
 		if (i->tag.len==tag->len
+				&& i->tag.s
 				&& memcmp(i->tag.s, tag->s, tag->len) ==0 ){
 				&& memcmp(i->tag.s, tag->s, tag->len) ==0 ){
 			/* to tag already recorded */
 			/* to tag already recorded */
 			LM_DBG("to-tag retransmission\n");
 			LM_DBG("to-tag retransmission\n");