Browse Source

libubus: increase stack depth for processing obj msgs

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>
Felix Fietkau 2 years ago
parent
commit
a72457b61d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libubus.c

+ 2 - 0
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)