-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
TP3-9508/server_src/referencefountain.cpp
Lines 3 to 5 in 34f95ac
| std::string Referencefountain::getReferenceFrom(const std::string& key) { | |
| std::unique_lock<std::mutex> lock(m); | |
| return references[key]; |
El operador [] de un std::map realiza un insert del elemento indexado con key, poniendole un valor vacío. Si esto fuera un servidor HTTP real, este mapa podría consumir mucha memoria por GETs mal hechos. Si yo hiciera "GET /asdfasdf" ese nodo se te va a insertar en tu mapa. Un ataque de DOS haria explotar a tu servidor.
Metadata
Metadata
Assignees
Labels
No labels