libubus: increase stack depth for processing obj msgs
authorFelix Fietkau <nbd@nbd.name>
Mon, 9 Aug 2021 10:56:54 +0000 (12:56 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 8 Sep 2021 10:25:31 +0000 (12:25 +0200)
Avoid running into an issue where issuing a request from an obj message
can lead to recursive message processing and list corruption

Signed-off-by: Felix Fietkau <nbd@nbd.name>
libubus.c

index 7ce454eabc648bcafccf3e6f5248c31228897b68..aee2a3b722a7d30756fe6a2ceac081c1775326c7 100644 (file)
--- a/libubus.c
+++ b/libubus.c
@@ -103,7 +103,9 @@ ubus_process_msg(struct ubus_context *ctx, struct ubus_msghdr_buf *buf, int fd)
                        break;
                }
 
+               ctx->stack_depth++;
                ubus_process_obj_msg(ctx, buf, fd);
+               ctx->stack_depth--;
                break;
        case UBUS_MSG_MONITOR:
                if (ctx->monitor_cb)