From 219248d43ef22758d233606578c0237a54a5d2e3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 12 Jan 2021 10:12:26 +0100 Subject: [PATCH] connection: guard against NULL --- src/modules/module-protocol-native/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-native/connection.c b/src/modules/module-protocol-native/connection.c index 5d162fdd2..212e9c948 100644 --- a/src/modules/module-protocol-native/connection.c +++ b/src/modules/module-protocol-native/connection.c @@ -281,7 +281,7 @@ static int ensure_stack_level(struct impl *impl, struct pw_protocol_native_messa { void *data; struct buffer *buf = &impl->in; - struct reenter_item *item, *new_item; + struct reenter_item *item, *new_item = NULL; item = spa_list_last(&impl->reenter_stack, struct reenter_item, link); @@ -330,6 +330,8 @@ static int ensure_stack_level(struct impl *impl, struct pw_protocol_native_messa impl->pending_reentering = 0; } + if (new_item == NULL) + return -EIO; /* Ensure fds buffer is allocated */ if (SPA_UNLIKELY(new_item->return_msg.fds == NULL)) {