security: fix create_tag check to allow upload stream memblocks

The create_tag guard added in a2de6c886 also rejected memblocks for
upload streams, which never clear create_tag. Upload streams allocate
their buffer immediately, so the NULL deref risk does not apply to
them. Exempt STREAM_TYPE_UPLOAD from the check.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-29 18:16:52 +02:00
parent 3a3579ed68
commit 6a8c2469c5

View file

@ -128,7 +128,7 @@ static int handle_memblock(struct client *client, struct message *msg)
stream = pw_map_lookup(&client->streams, channel);
if (stream == NULL || stream->type == STREAM_TYPE_RECORD ||
stream->create_tag != SPA_ID_INVALID) {
(stream->type != STREAM_TYPE_UPLOAD && stream->create_tag != SPA_ID_INVALID)) {
pw_log_info("client %p [%s]: received memblock for unknown channel %d",
client, client->name, channel);
goto finish;