Seems the UBUS_MAX_MSGLEN is ignored by ubus_invoke(),
and then segfault happens.

This issue is present before this set of patches.

---
 libubus-req.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libubus-req.c b/libubus-req.c
index f24f033..8475dc9 100644
--- a/libubus-req.c
+++ b/libubus-req.c
@@ -224,8 +224,12 @@ int ubus_invoke(struct ubus_context *ctx, uint32_t obj, 
const char *method,
                int timeout)
 {
        struct ubus_request req;
+       int rc;
+
+       rc = ubus_invoke_async(ctx, obj, method, msg, &req);
+       if (rc)
+               return rc;
 
-       ubus_invoke_async(ctx, obj, method, msg, &req);
        req.data_cb = cb;
        req.priv = priv;
        return ubus_complete_request(ctx, &req, timeout);
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to