From a0796cad4aab647d9c357bc7c03d4b0dc8d7fb27 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 26 Jun 2002 19:15:07 +1000 Subject: [PATCH] - markus@cvs.openbsd.org 2002/06/26 08:58:26 [session.c] limit # of env vars to 1000; ok deraadt/djm --- ChangeLog | 5 ++++- session.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9db38e61..88b155ff1 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 aadc82fef..51c8a0ae4 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 *)); }