Преглед на файлове

pua: safety check on tuple_id len

Daniel-Constantin Mierla преди 7 години
родител
ревизия
2bb33a8888
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/modules/pua/add_events.c

+ 4 - 0
src/modules/pua/add_events.c

@@ -183,6 +183,10 @@ int pres_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple_pa
 	{
 		if(tuple== NULL)
 		{
+			if(strlen(tuple_id)>=50) {
+				LM_ERR("tuple id is too long: %s\n", tuple_id);
+				goto error;
+			}
 			strcpy(buf, tuple_id);
 			xmlFree(tuple_id);
 			tuple_id= buf;