diff options
author | John Crispin <blogic@openwrt.org> | 2013-09-04 14:46:49 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-09-13 17:35:55 +0200 |
commit | 72c21573149f77c4afa41afb0f5216c2ab1555ea (patch) | |
tree | 6257ebfb344f8826b49bea2bdbd713ac56885804 /service.c | |
parent | 11a65fae34ee7900453c079eb80755f135395258 (diff) | |
download | unitd-72c21573149f77c4afa41afb0f5216c2ab1555ea.tar unitd-72c21573149f77c4afa41afb0f5216c2ab1555ea.zip |
fix a bug in the trigger handling code
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'service.c')
-rw-r--r-- | service.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -108,10 +108,10 @@ service_update(struct service *s, struct blob_attr *config, struct blob_attr **t } if (tb[SERVICE_SET_TRIGGER] && blobmsg_data_len(tb[SERVICE_SET_TRIGGER])) { - s->trigger = malloc(blob_len(tb[SERVICE_SET_TRIGGER])); + s->trigger = malloc(blob_pad_len(tb[SERVICE_SET_TRIGGER])); if (!s->trigger) return -1; - memcpy(s->trigger, tb[SERVICE_SET_TRIGGER], blob_len(tb[SERVICE_SET_TRIGGER])); + memcpy(s->trigger, tb[SERVICE_SET_TRIGGER], blob_pad_len(tb[SERVICE_SET_TRIGGER])); trigger_add(s->trigger, s); } |