projects
/
oweals
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
996e16b
)
libubus: fix ubus_invoke() to return err in case ubus_start_request() fails
author
Alexandru Ardelean
<ardeleanalex@gmail.com>
Fri, 27 Jun 2014 16:11:44 +0000
(19:11 +0300)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 3 Jul 2014 10:46:44 +0000
(12:46 +0200)
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
patch
|
blob
|
history
diff --git
a/libubus-req.c
b/libubus-req.c
index f24f033d9d65da38ebbd5dac53f2cce4a16b4df3..8475dc9abf1514a4f90f030d1051f0032b27a6c6 100644
(file)
--- 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);