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
SDL core will return incorrect JSON in the response for an OnHMIStatus RPC if the RPC doesn't have the correct parameters.
{
"hmiLevel" : null
}
A message uses an internal C++ map. Since maps use default-construction for accessing non-existent entries, the use of the [] accessor creates an invalid hmiLevel which is then passed to the mobile device.
This means that doing something like Map[strings::msg_params][strings::hmi_level] will create an entry if none exists. This invalid entry translates to extra JSON that lacks required fields and has a null HMI level.
Reproduction Steps
Connect any app to SDL and make an OnHMIStatus RPC with a missing parameter (for example, the new videoStreamingState parameter). SDL core will try to validate the parameters and catch the missing one, causing it to return INVALID_DATA and report a failure. However, before forwarding this message to the mobile device it attempts to perform checks on the hmiLevel field of the message. This creates an invalid HMI level which is then passed on the mobile device as a null JSON entry.
Expected Behavior
Core should return INVALID_DATA and no hmi level or other information.
Observed Behavior
Core returns INVALID_DATA but also returns an incorrect hmi level parameter.
OS & Version Information
OS/Version: Ubuntu 18.04
SDL Core Version: develop
Testing Against: iOS app, Generic & SDL HMIs
Test Case, Sample Code, and / or Example App
Unless the field is checked to exist first, Map[strings::msg_params][strings::hmi_level] will cause such a field to exist, even when not desired.
The text was updated successfully, but these errors were encountered:
Bug Report
SDL core will return incorrect JSON in the response for an OnHMIStatus RPC if the RPC doesn't have the correct parameters.
A message uses an internal C++ map. Since maps use default-construction for accessing non-existent entries, the use of the
[]
accessor creates an invalidhmiLevel
which is then passed to the mobile device.This means that doing something like
Map[strings::msg_params][strings::hmi_level]
will create an entry if none exists. This invalid entry translates to extra JSON that lacks required fields and has anull
HMI level.Reproduction Steps
Connect any app to SDL and make an OnHMIStatus RPC with a missing parameter (for example, the new
videoStreamingState
parameter). SDL core will try to validate the parameters and catch the missing one, causing it to returnINVALID_DATA
and report a failure. However, before forwarding this message to the mobile device it attempts to perform checks on thehmiLevel
field of the message. This creates an invalid HMI level which is then passed on the mobile device as anull
JSON entry.Expected Behavior
Core should return
INVALID_DATA
and no hmi level or other information.Observed Behavior
Core returns
INVALID_DATA
but also returns an incorrect hmi level parameter.OS & Version Information
Test Case, Sample Code, and / or Example App
Unless the field is checked to exist first,
Map[strings::msg_params][strings::hmi_level]
will cause such a field to exist, even when not desired.The text was updated successfully, but these errors were encountered: