From f2e3e9deba2de12a01de9cf74befb6e94a3781d2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 2 Jun 2003 12:15:54 +1000 Subject: [PATCH] - (djm) Always use saved_argv in sshd.c as compat_init_setproctitle may clobber --- ChangeLog | 4 +++- sshd.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 408540490..118f29dd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20030602 - (djm) Fix segv from bad reordering in auth-pam.c + - (djm) Always use saved_argv in sshd.c as compat_init_setproctitle may + clobber 20030530 - (dtucker) Add missing semicolon in md5crypt.c, patch from openssh at @@ -1626,4 +1628,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2755 2003/06/02 02:13:40 djm Exp $ +$Id: ChangeLog,v 1.2756 2003/06/02 02:15:54 djm Exp $ diff --git a/sshd.c b/sshd.c index 3f1e9ff64..eb4e4876e 100644 --- a/sshd.c +++ b/sshd.c @@ -825,7 +825,6 @@ 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 + 1)); for (i = 0; i < ac; i++) saved_argv[i] = xstrdup(av[i]); @@ -834,6 +833,7 @@ main(int ac, char **av) #ifndef HAVE_SETPROCTITLE /* Prepare for later setproctitle emulation */ compat_init_setproctitle(ac, av); + av = saved_argv; #endif /* Initialize configuration options to their default values. */