summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2009-06-21 17:49:36 +1000
committerDarren Tucker <dtucker@zip.com.au>2009-06-21 17:49:36 +1000
commita0964504e19598ca5a45dbf0ed0c677e4f24c132 (patch)
tree95b448d45113f40cd62bab4415b7b9bb47a20d16 /ssh-agent.c
parent3a6a51f3874209046df3ac6ca11180b9ca31062d (diff)
- tobias@cvs.openbsd.org 2009/03/23 08:31:19
[ssh-agent.c] Fixed a possible out-of-bounds memory access if the environment variable SHELL is shorter than 3 characters. with input by and ok dtucker
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c4
1 files changed, 2 insertions, 2 deletions
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) {