X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=service.c;h=7776f9973743a2e1b89b9d03cc1df854fb8968fd;hp=5647ae5e52828ac91db800e74ecb4a1f3fda511f;hb=72c21573149f77c4afa41afb0f5216c2ab1555ea;hpb=11a65fae34ee7900453c079eb80755f135395258 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); }