Explorar o código

textopsx: msg_apply_changes() exits config execution if result is not parsing well

- sip_msg_t structure is can be invalid
- similar behavior with the case when the message is broken from the
  network, it doesn't get to config file
- reported by Marco B.
Daniel-Constantin Mierla %!s(int64=11) %!d(string=hai) anos
pai
achega
55960106bb
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      modules/textopsx/textopsx.c

+ 5 - 2
modules/textopsx/textopsx.c

@@ -228,8 +228,11 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, char *str2)
 	/* reparse the message */
 	LM_DBG("SIP message content updated - reparsing\n");
 	if (parse_msg(msg->buf, msg->len, msg)!=0){
-		LM_ERR("parsing new sip message failed\n");
-		return -1;
+		LM_ERR("parsing new sip message failed [[%.*s]]\n",
+				msg->len, msg->buf);
+		/* exit config execution - sip_msg_t structure is no longer
+		 * valid/safe for config */
+		return 0;
 	}
 
 	return 1;