summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-05-28 19:39:33 +0000
committerdes <des@FreeBSD.org>2003-05-28 19:39:33 +0000
commit108403d091a2b07a798dc5c9081b9bc5464a537d (patch)
treef3ff73ee4345dab4a28c9df55a275d7dfed4cc96 /crypto
parent76f669c167b132d3a4da3cc7e6b5a7f41d676a92 (diff)
downloadFreeBSD-src-108403d091a2b07a798dc5c9081b9bc5464a537d.zip
FreeBSD-src-108403d091a2b07a798dc5c9081b9bc5464a537d.tar.gz
Fix off-by-one and initialization errors which prevented sshd from
restarting when sent a SIGHUP. Submitted by: tegge Approved by: re (jhb)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/openssh/sshd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index a81e17a..bdf16d1 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -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 */
OpenPOWER on IntegriCloud