projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2475541
)
proto-shell: Fix possible segfault
author
Hans Dedecker
<dedeckeh@gmail.com>
Mon, 1 Feb 2016 09:56:21 +0000
(10:56 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 1 Feb 2016 10:09:57 +0000
(11:09 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto-shell.c
patch
|
blob
|
history
diff --git
a/proto-shell.c
b/proto-shell.c
index 8a3ff69bedd0f16ae5b2079435b6777046df9787..25dec00990979ec31d8c180a7bdb64e02027b128 100644
(file)
--- a/
proto-shell.c
+++ b/
proto-shell.c
@@
-708,6
+708,8
@@
proto_shell_add_host_dependency(struct proto_shell_state *state, struct blob_att
return UBUS_STATUS_PERMISSION_DENIED;
dep = calloc(1, sizeof(*dep) + strlen(ifname) + 1);
+ if (!dep)
+ return UBUS_STATUS_UNKNOWN_ERROR;
if (!host[0] && ifname[0]) {
dep->any = true;
@@
-834,6
+836,9
@@
proto_shell_attach(const struct proto_handler *h, struct interface *iface,
struct proto_shell_state *state;
state = calloc(1, sizeof(*state));
+ if (!state)
+ return NULL;
+
INIT_LIST_HEAD(&state->deps);
state->config = malloc(blob_pad_len(attr));