You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And the server kept crashing when a request without that key was made
so i investigated
part get_part_by_name(const std::string& name)
{
return part_map.find(name)->second;
}
this current implementation tries to imediately acces the object but if that object does not exist it tries to access part.end() which is unallocated memory.
i replaced it with
part get_part_by_name(const std::string& name)
{
mp_map::iterator result = part_map.find(name);
if(result != part_map.end())
return result->second;
elsereturn {};
}
which seems to fix the issue and i am still able to check the body of the part or headers
please let me know if everything is correct and my fix is good :)
The text was updated successfully, but these errors were encountered:
I was working with this
And the server kept crashing when a request without that key was made
so i investigated
this current implementation tries to imediately acces the object but if that object does not exist it tries to access part.end() which is unallocated memory.
i replaced it with
which seems to fix the issue and i am still able to check the body of the part or headers
please let me know if everything is correct and my fix is good :)
The text was updated successfully, but these errors were encountered: