Fix off-by-one and initialization errors which prevented sshd from
restarting when sent a SIGHUP. Submitted by: tegge Approved by: re (jhb)
This commit is contained in:
parent
76f669c167
commit
108403d091
@ -835,9 +835,10 @@ main(int ac, char **av)
|
||||
/* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
|
||||
saved_argc = ac;
|
||||
saved_argv = av;
|
||||
saved_argv = xmalloc(sizeof(*saved_argv) * ac);
|
||||
saved_argv = xmalloc(sizeof(*saved_argv) * (ac + 1));
|
||||
for (i = 0; i < ac; i++)
|
||||
saved_argv[i] = xstrdup(av[i]);
|
||||
saved_argv[ac] = NULL;
|
||||
|
||||
#ifndef HAVE_SETPROCTITLE
|
||||
/* Prepare for later setproctitle emulation */
|
||||
|
Loading…
x
Reference in New Issue
Block a user