Skip to content

Profile type not checked in input #355

@jcoupey

Description

@jcoupey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions