summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-06-26 19:15:07 +1000
committerDamien Miller <djm@mindrot.org>2002-06-26 19:15:07 +1000
commita0796cad4aab647d9c357bc7c03d4b0dc8d7fb27 (patch)
treeb477e35af75d5949176397c86ce4fbbd071dcc6e /session.c
parent9403aa2f79cac6e1565324d5d33d572f62932187 (diff)
- markus@cvs.openbsd.org 2002/06/26 08:58:26
[session.c] limit # of env vars to 1000; ok deraadt/djm
Diffstat (limited to 'session.c')
-rw-r--r--session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/session.c b/session.c
index aadc82fe..51c8a0ae 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.140 2002/06/23 21:06:41 deraadt Exp $");
+RCSID("$OpenBSD: session.c,v 1.141 2002/06/26 08:58:26 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -849,6 +849,9 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
} else {
/* New variable. Expand if necessary. */
if (i >= (*envsizep) - 1) {
+ if (*envsizep >= 1000)
+ fatal("child_set_env: too many env vars,"
+ " skipping: %.100s", name);
(*envsizep) += 50;
env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *));
}