Signed-off-by: John Crispin <blogic@openwrt.org>
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);
}
}
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);
}