pulse-server: stricter length checking when deserializing property list

The length of the value for each value in a property list is serialized
twice. Both the reference implementation and pipewire-pulse send
the same length, so be stricter and only accept a property list
if both lengths are the same.
This commit is contained in:
Barnabás Pőcze 2024-03-19 16:57:02 +01:00 committed by Wim Taymans
parent 2b11efdf3b
commit 12bddf6521

View file

@ -122,6 +122,9 @@ static int read_props(struct message *m, struct pw_properties *props, bool remap
TAG_INVALID)) < 0) TAG_INVALID)) < 0)
return res; return res;
if (length != size)
return -EINVAL;
if (remap && (map = str_map_find(props_key_map, NULL, key)) != NULL) { if (remap && (map = str_map_find(props_key_map, NULL, key)) != NULL) {
key = map->pw_str; key = map->pw_str;
if (map->child != NULL && if (map->child != NULL &&