From: Nathan Hintz Date: Fri, 29 Dec 2017 04:48:26 +0000 (+0000) Subject: procd: initd: fix path allocation in early_insmod X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=7aad9409d22dc38b71ec75d2aafcfa32426b5594;ds=sidebyside procd: initd: fix path allocation in early_insmod Noticed that /tmp was not being created on /dev/zram0. This was on ixp4xx (nslu2) using GCC 6.3 and musl. The allocation should be using the length of the passed string (module path), not the size of the pointer to the string. Signed-off-by: Nathan Hintz --- diff --git a/initd/zram.c b/initd/zram.c index 0e78195..da1795a 100644 --- a/initd/zram.c +++ b/initd/zram.c @@ -60,7 +60,7 @@ early_insmod(char *module) struct utsname ver; uname(&ver); - path = alloca(sizeof(module) + strlen(ver.release) + 1); + path = alloca(strlen(module) + strlen(ver.release) + 1); sprintf(path, module, ver.release); modprobe[1] = path; execvp(modprobe[0], modprobe);