summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--instance.c4
-rw-r--r--service.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/instance.c b/instance.c
index e6fc331..4230d0d 100644
--- a/instance.c
+++ b/instance.c
@@ -339,10 +339,10 @@ instance_config_parse(struct service_instance *in)
in->respawn_retry = vals[2];
}
if (tb[INSTANCE_ATTR_TRIGGER]) {
- in->trigger = malloc(blob_len(tb[INSTANCE_ATTR_TRIGGER]));
+ in->trigger = malloc(blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
if (!in->trigger)
return -1;
- memcpy(in->trigger, tb[INSTANCE_ATTR_TRIGGER], blob_len(tb[INSTANCE_ATTR_TRIGGER]));
+ memcpy(in->trigger, tb[INSTANCE_ATTR_TRIGGER], blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
trigger_add(in->trigger, in);
}
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);
}