libubus: increase stack depth for processing obj msgs
[project/ubus.git] / ubusd_main.c
index 1c8953737c41d064a8b418d76405c999fa2f748d..e102186b43ab9cc006c3f58c8245e877482049c7 100644 (file)
@@ -72,9 +72,11 @@ static void client_cb(struct uloop_fd *sock, unsigned int events)
                }
 
                cl->txq_ofs += written;
+               cl->txq_len -= written;
                if (cl->txq_ofs < ub->len + sizeof(ub->hdr))
                        break;
 
+               cl->txq_ofs = 0;
                ubus_msg_list_free(ubl);
        }
 
@@ -112,6 +114,8 @@ retry:
                if (cl->pending_msg_offset < (int) sizeof(cl->hdrbuf))
                        goto out;
 
+               if (blob_raw_len(&cl->hdrbuf.data) < sizeof(struct blob_attr))
+                       goto disconnect;
                if (blob_pad_len(&cl->hdrbuf.data) > UBUS_MAX_MSGLEN)
                        goto disconnect;