pulse-server: avoid reading past the message size

We can't really get into this situation but it is a good idea to check
that we don't try to read past the message length.
This commit is contained in:
Wim Taymans 2021-11-25 09:48:34 +01:00
parent d79d2f69fb
commit 5d20e3028a

View file

@ -195,7 +195,7 @@ static int do_read(struct client *client)
} else {
uint32_t idx = client->in_index - sizeof(client->desc);
if (client->message == NULL) {
if (client->message == NULL || client->message->length < idx) {
res = -EPROTO;
goto exit;
}