diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ssh-agent.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -11,6 +11,11 @@ | |||
11 | fixes documentation/6102, submitted by Peter J. Philipp | 11 | fixes documentation/6102, submitted by Peter J. Philipp |
12 | alternative fix proposed by djm | 12 | alternative fix proposed by djm |
13 | ok markus | 13 | ok markus |
14 | - tobias@cvs.openbsd.org 2009/03/23 08:31:19 | ||
15 | [ssh-agent.c] | ||
16 | Fixed a possible out-of-bounds memory access if the environment variable | ||
17 | SHELL is shorter than 3 characters. | ||
18 | with input by and ok dtucker | ||
14 | 19 | ||
15 | 20090616 | 20 | 20090616 |
16 | - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t | 21 | - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t |
diff --git a/ssh-agent.c b/ssh-agent.c index 9123cfe6b..1a54a2784 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.159 2008/06/28 14:05:15 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.160 2009/03/23 08:31:19 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 |
@@ -1122,7 +1122,7 @@ main(int ac, char **av) | |||
1122 | if (ac == 0 && !c_flag && !s_flag) { | 1122 | if (ac == 0 && !c_flag && !s_flag) { |
1123 | shell = getenv("SHELL"); | 1123 | shell = getenv("SHELL"); |
1124 | if (shell != NULL && | 1124 | if (shell != NULL && |
1125 | strncmp(shell + strlen(shell) - 3, "csh", 3) == 0) | 1125 | strncmp(shell + MAX(strlen(shell) - 3, 0), "csh", 3) == 0) |
1126 | c_flag = 1; | 1126 | c_flag = 1; |
1127 | } | 1127 | } |
1128 | if (k_flag) { | 1128 | if (k_flag) { |