Переглянути джерело

topoh: safety checks for couple of mandatory headers

- first via and call-id
- GH #1735

(cherry picked from commit 97da6b1a5f656db4a91c8909167706fc8ec3d932)
Daniel-Constantin Mierla 6 роки тому
батько
коміт
01828ecdff
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      src/modules/topoh/topoh_mod.c

+ 6 - 0
src/modules/topoh/topoh_mod.c

@@ -286,6 +286,12 @@ int th_prepare_msg(sip_msg_t *msg)
 		return 3;
 	}
 
+	if(msg->via1==NULL || msg->callid==NULL) {
+		LM_ERR("mandatory headers missing - via1: %p callid: %p\n",
+				msg->via1, msg->callid);
+		return 4;
+	}
+
 	return 0;
 }