The current way we parse strings in json input is as follows:
|
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.
The current way we parse strings in json input is as follows:
vroom/src/utils/input_parser.cpp
Lines 50 to 53 in 638f6d1
This is currently only used to retrieve the
vehicle.profilevalue (if present). We enforce a check on whether the key exists but not on the actual type before callingGetString. As a result, setting e.g."profile": 42for a vehicle hits arapidjsonassertion or crashes.