Explorar o código

pua: safety check on tuple_id len

Daniel-Constantin Mierla %!s(int64=7) %!d(string=hai) anos
pai
achega
2bb33a8888
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;