projects
/
project
/
rpcd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6a00d27
)
Fix session.get procedure with undefined keys attribute
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 30 May 2013 12:58:30 +0000
(14:58 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 30 May 2013 12:58:30 +0000
(14:58 +0200)
session.c
patch
|
blob
|
history
diff --git
a/session.c
b/session.c
index
9c2b35d
..
6352354
100644
(file)
--- a/
session.c
+++ b/
session.c
@@
-525,24
+525,22
@@
rpc_handle_get(struct ubus_context *ctx, struct ubus_object *obj,
blob_buf_init(&buf, 0);
c = blobmsg_open_table(&buf, "values");
blob_buf_init(&buf, 0);
c = blobmsg_open_table(&buf, "values");
- if (!tb[RPC_SG_KEYS]) {
- rpc_session_dump_data(ses, &buf);
- return 0;
- }
-
- blobmsg_for_each_attr(attr, tb[RPC_SG_KEYS], rem) {
- if (blob_id(attr) != BLOBMSG_TYPE_STRING)
- continue;
+ if (tb[RPC_SG_KEYS])
+ blobmsg_for_each_attr(attr, tb[RPC_SG_KEYS], rem) {
+ if (blob_id(attr) != BLOBMSG_TYPE_STRING)
+ continue;
- data = avl_find_element(&ses->data, blobmsg_data(attr), data, avl);
- if (!data)
- continue;
+
data = avl_find_element(&ses->data, blobmsg_data(attr), data, avl);
+
if (!data)
+
continue;
- blobmsg_add_field(&buf, blobmsg_type(data->attr),
- blobmsg_name(data->attr),
- blobmsg_data(data->attr),
- blobmsg_data_len(data->attr));
- }
+ blobmsg_add_field(&buf, blobmsg_type(data->attr),
+ blobmsg_name(data->attr),
+ blobmsg_data(data->attr),
+ blobmsg_data_len(data->attr));
+ }
+ else
+ rpc_session_dump_data(ses, &buf);
blobmsg_close_table(&buf, c);
ubus_send_reply(ctx, req, buf.head);
blobmsg_close_table(&buf, c);
ubus_send_reply(ctx, req, buf.head);