diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ssh-agent.c | 7 |
2 files changed, 10 insertions, 3 deletions
@@ -16,6 +16,12 @@ | |||
16 | Fixed a possible out-of-bounds memory access if the environment variable | 16 | Fixed a possible out-of-bounds memory access if the environment variable |
17 | SHELL is shorter than 3 characters. | 17 | SHELL is shorter than 3 characters. |
18 | with input by and ok dtucker | 18 | with input by and ok dtucker |
19 | - tobias@cvs.openbsd.org 2009/03/23 19:38:04 | ||
20 | [ssh-agent.c] | ||
21 | My previous commit didn't fix the problem at all, so stick at my first | ||
22 | version of the fix presented to dtucker. | ||
23 | Issue notified by Matthias Barkhoff (matthias dot barkhoff at gmx dot de). | ||
24 | ok dtucker | ||
19 | 25 | ||
20 | 20090616 | 26 | 20090616 |
21 | - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t | 27 | - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t |
diff --git a/ssh-agent.c b/ssh-agent.c index 1a54a2784..f77dea3a6 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.160 2009/03/23 08:31:19 tobias Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.161 2009/03/23 19:38:04 tobias Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1061,6 +1061,7 @@ main(int ac, char **av) | |||
1061 | pid_t pid; | 1061 | pid_t pid; |
1062 | char pidstrbuf[1 + 3 * sizeof pid]; | 1062 | char pidstrbuf[1 + 3 * sizeof pid]; |
1063 | struct timeval *tvp = NULL; | 1063 | struct timeval *tvp = NULL; |
1064 | size_t len; | ||
1064 | 1065 | ||
1065 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | 1066 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
1066 | sanitise_stdfd(); | 1067 | sanitise_stdfd(); |
@@ -1121,8 +1122,8 @@ main(int ac, char **av) | |||
1121 | 1122 | ||
1122 | if (ac == 0 && !c_flag && !s_flag) { | 1123 | if (ac == 0 && !c_flag && !s_flag) { |
1123 | shell = getenv("SHELL"); | 1124 | shell = getenv("SHELL"); |
1124 | if (shell != NULL && | 1125 | if (shell != NULL && (len = strlen(shell)) > 2 && |
1125 | strncmp(shell + MAX(strlen(shell) - 3, 0), "csh", 3) == 0) | 1126 | strncmp(shell + len - 3, "csh", 3) == 0) |
1126 | c_flag = 1; | 1127 | c_flag = 1; |
1127 | } | 1128 | } |
1128 | if (k_flag) { | 1129 | if (k_flag) { |