Index: sbin/init/init.c =================================================================== --- sbin/init/init.c +++ sbin/init/init.c @@ -1047,7 +1047,7 @@ struct sigaction sa; char* sh_argv[3 + SCRIPT_ARGV_SIZE]; const char *shell, *script; - int error, sh_argv_id; + int error, sh_argv_len, i; bzero(&sa, sizeof(sa)); sigemptyset(&sa.sa_mask); @@ -1079,16 +1079,16 @@ shell = get_shell(); sh_argv[0] = __DECONST(char*, shell); - sh_argv_id = 1; + sh_argv_len = 1; #ifdef SECURE - if (strcmp(shell, _PATH_BSHELL) == 0) - { + if (strcmp(shell, _PATH_BSHELL) == 0) { sh_argv[1] = __DECONST(char*, "-o"); sh_argv[2] = __DECONST(char*, "verify"); - sh_argv_id = 3; + sh_argv_len = 3; } #endif - memcpy(sh_argv + sh_argv_id, argv, sizeof(char*)*SCRIPT_ARGV_SIZE); + for (i = 0; i != SCRIPT_ARGV_SIZE; ++i) + sh_argv[i + sh_argv_len] = argv[i]; execv(shell, sh_argv); stall("can't exec %s for %s: %m", shell, script); }