1
Fork 0

protocol: don't allow NULL event or command

If causes crashes when the handlers try to get the ID.
This commit is contained in:
Wim Taymans 2024-01-03 14:04:13 +01:00
parent 4ef891b047
commit 0fd0582514
2 changed files with 12 additions and 0 deletions

View File

@ -412,6 +412,9 @@ static int client_node_demarshal_event_event(void *data, const struct pw_protoco
SPA_POD_PodObject(&event)) < 0)
return -EINVAL;
if (event == NULL)
return -EINVAL;
pw_proxy_notify(proxy, struct pw_client_node_events, event, 0, event);
return 0;
}
@ -427,6 +430,9 @@ static int client_node_demarshal_command(void *data, const struct pw_protocol_na
SPA_POD_PodObject(&command)) < 0)
return -EINVAL;
if (command == NULL)
return -EINVAL;
pw_proxy_notify(proxy, struct pw_client_node_events, command, 0, command);
return 0;
}
@ -1097,6 +1103,9 @@ static int client_node_demarshal_event_method(void *object, const struct pw_prot
SPA_POD_PodObject(&event)) < 0)
return -EINVAL;
if (event == NULL)
return -EINVAL;
pw_resource_notify(resource, struct pw_client_node_methods, event, 0, event);
return 0;
}

View File

@ -1342,6 +1342,9 @@ static int node_demarshal_send_command(void *object, const struct pw_protocol_na
SPA_POD_Pod(&command)) < 0)
return -EINVAL;
if (command == NULL)
return -EINVAL;
return pw_resource_notify(resource, struct pw_node_methods, send_command, 0, command);
}