From 04cb5360545617905ba9099027dd381fc9729344 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 15 May 2003 21:29:10 +1000 Subject: [PATCH] - (djm) Bug #529: sshd doesn't work correctly after SIGHUP (copy argv correctly) --- ChangeLog | 5 ++++- sshd.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf783a367..d2c60e8fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,9 @@ - (djm) Avoid uuencode.c warnings - (djm) Enable UsePAM when built --with-pam - (djm) Only build getrrsetbyname replacement when using --with-dns + - (djm) Bug #529: sshd doesn't work correctly after SIGHUP (copy argv + correctly) + 20030514 - (djm) Bug #117: Don't lie to PAM about username - (djm) RCSID sync w/ OpenBSD @@ -1523,4 +1526,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2720 2003/05/15 10:55:27 djm Exp $ +$Id: ChangeLog,v 1.2721 2003/05/15 11:29:10 djm Exp $ diff --git a/sshd.c b/sshd.c index cb70fa0c6..c0221bea7 100644 --- a/sshd.c +++ b/sshd.c @@ -830,9 +830,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[i] = NULL; #ifndef HAVE_SETPROCTITLE /* Prepare for later setproctitle emulation */