From 72c21573149f77c4afa41afb0f5216c2ab1555ea Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 4 Sep 2013 14:46:49 +0200 Subject: fix a bug in the trigger handling code Signed-off-by: John Crispin --- service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'service.c') diff --git a/service.c b/service.c index 5647ae5..7776f99 100644 --- a/service.c +++ b/service.c @@ -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); } -- cgit v1.2.3