mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-08 10:06:23 -05:00
pulse-server: return length of TAG_ARBITRARY
So that we don't have to know the length beforehand but can still check it.
This commit is contained in:
parent
bc46ead017
commit
bba24b9ff8
2 changed files with 12 additions and 9 deletions
|
|
@ -449,15 +449,18 @@ static int do_command_auth(struct client *client, uint32_t command, uint32_t tag
|
|||
struct message *reply;
|
||||
uint32_t version;
|
||||
const void *cookie;
|
||||
size_t len;
|
||||
|
||||
if (message_get(m,
|
||||
TAG_U32, &version,
|
||||
TAG_ARBITRARY, &cookie, NATIVE_COOKIE_LENGTH,
|
||||
TAG_ARBITRARY, &cookie, &len,
|
||||
TAG_INVALID) < 0) {
|
||||
return -EPROTO;
|
||||
}
|
||||
if (version < 8)
|
||||
return -EPROTO;
|
||||
if (len != NATIVE_COOKIE_LENGTH)
|
||||
return -EINVAL;
|
||||
|
||||
if ((version & PROTOCOL_VERSION_MASK) >= 13)
|
||||
version &= PROTOCOL_VERSION_MASK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue