mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
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:
parent
52afec565b
commit
9c1bc64af4
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue