projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6b38cb
)
fix a heap overrun
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 3 Oct 2011 00:37:54 +0000
(
02:37
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 3 Oct 2011 00:37:54 +0000
(
02:37
+0200)
proto-shell.c
patch
|
blob
|
history
diff --git
a/proto-shell.c
b/proto-shell.c
index 5937e522818cee0c7b2385920ce8fc72023b5598..555004e6c9ffa74b3af21ca7ad0c3d5b335ad18a 100644
(file)
--- a/
proto-shell.c
+++ b/
proto-shell.c
@@
-382,11
+382,11
@@
proto_shell_parse_config(struct config_param_list *config, json_object *obj)
int str_len = 0;
int i;
- attrs = calloc(1, sizeof(*attrs));
+ config->n_params = json_object_array_length(obj);
+ attrs = calloc(1, sizeof(*attrs) * config->n_params);
if (!attrs)
return NULL;
- config->n_params = json_object_array_length(obj);
config->params = attrs;
for (i = 0; i < config->n_params; i++) {
json_object *cur, *name, *type;