security: add missing NULL check after message_alloc in PulseAudio server

message_alloc can return NULL on allocation failure but the result
was not checked, causing the next do_read call to misinterpret
the NULL as a protocol error instead of an OOM condition.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-29 16:42:59 +02:00
parent 52afec565b
commit 9c1bc64af4

View file

@ -274,6 +274,10 @@ static int do_read(struct client *client)
message_free(client->message, false, false);
client->message = message_alloc(impl, channel, length);
if (client->message == NULL) {
res = -ENOMEM;
goto exit;
}
} else if (client->message &&
client->in_index >= client->message->length + sizeof(client->desc)) {
struct message * const msg = client->message;