summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2009-03-23 19:38:05 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2009-03-23 19:38:05 +0000
commitc83304ae1a2a7be720666d02d1494674131267af (patch)
tree4bee187e94777600bb738945339285397ddace48
parent6267847c636b8bed7a1ab74dfd054103e781213b (diff)
My previous commit didn't fix the problem at all, so stick at my first
version of the fix presented to dtucker. Issue notified by Matthias Barkhoff (matthias dot barkhoff at gmx dot de). ok dtucker
-rw-r--r--usr.bin/ssh/ssh-agent.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 36c475f79cf..95bb75177bd 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.160 2009/03/23 08:31:19 tobias Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.161 2009/03/23 19:38:04 tobias Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1042,6 +1042,7 @@ main(int ac, char **av)
pid_t pid;
char pidstrbuf[1 + 3 * sizeof pid];
struct timeval *tvp = NULL;
+ size_t len;
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
sanitise_stdfd();
@@ -1093,8 +1094,8 @@ main(int ac, char **av)
if (ac == 0 && !c_flag && !s_flag) {
shell = getenv("SHELL");
- if (shell != NULL &&
- strncmp(shell + MAX(strlen(shell) - 3, 0), "csh", 3) == 0)
+ if (shell != NULL && (len = strlen(shell)) > 2 &&
+ strncmp(shell + len - 3, "csh", 3) == 0)
c_flag = 1;
}
if (k_flag) {