-
Notifications
You must be signed in to change notification settings - Fork 379
Closed
Description
The current way we parse strings in json input is as follows:
vroom/src/utils/input_parser.cpp
Lines 50 to 53 in 638f6d1
inline std::string get_string(const rapidjson::Value& object, const char* key) { | |
assert(object.HasMember(key)); | |
return object[key].GetString(); | |
} |
This is currently only used to retrieve the vehicle.profile
value (if present). We enforce a check on whether the key exists but not on the actual type before calling GetString
. As a result, setting e.g. "profile": 42
for a vehicle hits a rapidjson
assertion or crashes.