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:
Dag-Erling Smørgrav 2003-05-28 19:39:33 +00:00
parent 2ce0a0b9ec
commit da05574c54
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115372

View File

@ -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 */