Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Profile type not checked in input #355

Closed
jcoupey opened this issue Jun 25, 2020 · 0 comments
Closed

Profile type not checked in input #355

jcoupey opened this issue Jun 25, 2020 · 0 comments

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Jun 25, 2020

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant