bluez5: better error/malformed input handling

Safer parsing of AT commands, additional null and error checks.
This commit is contained in:
Pauli Virtanen 2021-03-27 13:55:01 +02:00 committed by Wim Taymans
parent f0a2b6d01f
commit f330446291
5 changed files with 56 additions and 21 deletions

View file

@ -1474,6 +1474,9 @@ static int impl_set_param(void *object,
uint32_t profile;
enum spa_bluetooth_audio_codec codec;
if (param == NULL)
return -EINVAL;
if ((res = spa_pod_parse_object(param,
SPA_TYPE_OBJECT_ParamProfile, NULL,
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id))) < 0) {
@ -1496,6 +1499,9 @@ static int impl_set_param(void *object,
struct spa_pod *props = NULL;
struct node *node;
if (param == NULL)
return -EINVAL;
if ((res = spa_pod_parse_object(param,
SPA_TYPE_OBJECT_ParamRoute, NULL,
SPA_PARAM_ROUTE_index, SPA_POD_Int(&id),