- markus@cvs.openbsd.org 2002/06/26 08:58:26
[session.c]
limit # of env vars to 1000; ok deraadt/djm
diff --git a/ChangeLog b/ChangeLog
index f9db38e..88b155f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,9 @@
- markus@cvs.openbsd.org 2002/06/26 08:55:02
[channels.c]
limit # of channels to 10000
+ - markus@cvs.openbsd.org 2002/06/26 08:58:26
+ [session.c]
+ limit # of env vars to 1000; ok deraadt/djm
20020625
- (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
@@ -1144,4 +1147,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
-$Id: ChangeLog,v 1.2292 2002/06/26 09:14:43 djm Exp $
+$Id: ChangeLog,v 1.2293 2002/06/26 09:15:07 djm Exp $
diff --git a/session.c b/session.c
index aadc82f..51c8a0a 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 @@
} 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 *));
}