[session.c]
     limit # of env vars to 1000; ok deraadt/djm
This commit is contained in:
Damien Miller 2002-06-26 19:15:07 +10:00
parent 9403aa2f79
commit a0796cad4a
2 changed files with 8 additions and 2 deletions

View File

@ -45,6 +45,9 @@
- markus@cvs.openbsd.org 2002/06/26 08:55:02 - markus@cvs.openbsd.org 2002/06/26 08:55:02
[channels.c] [channels.c]
limit # of channels to 10000 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 20020625
- (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
@ -1144,4 +1147,4 @@
- (stevesk) entropy.c: typo in debug message - (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@ - (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 $

View File

@ -33,7 +33,7 @@
*/ */
#include "includes.h" #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 "ssh.h"
#include "ssh1.h" #include "ssh1.h"
@ -849,6 +849,9 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
} else { } else {
/* New variable. Expand if necessary. */ /* New variable. Expand if necessary. */
if (i >= (*envsizep) - 1) { if (i >= (*envsizep) - 1) {
if (*envsizep >= 1000)
fatal("child_set_env: too many env vars,"
" skipping: %.100s", name);
(*envsizep) += 50; (*envsizep) += 50;
env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *)); env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *));
} }