Forráskód Böngészése

pua: safety check on tuple_id len

Daniel-Constantin Mierla 7 éve
szülő
commit
2bb33a8888
1 módosított fájl, 4 hozzáadás és 0 törlés
  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;