diff options
author | Damien Miller <djm@mindrot.org> | 2002-06-26 19:15:07 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-06-26 19:15:07 +1000 |
commit | a0796cad4aab647d9c357bc7c03d4b0dc8d7fb27 (patch) | |
tree | b477e35af75d5949176397c86ce4fbbd071dcc6e /session.c | |
parent | 9403aa2f79cac6e1565324d5d33d572f62932187 (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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.140 2002/06/23 21:06:41 deraadt Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.141 2002/06/26 08:58:26 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -849,6 +849,9 @@ child_set_env(char ***envp, u_int *envsizep, const char *name, | |||
849 | } else { | 849 | } else { |
850 | /* New variable. Expand if necessary. */ | 850 | /* New variable. Expand if necessary. */ |
851 | if (i >= (*envsizep) - 1) { | 851 | if (i >= (*envsizep) - 1) { |
852 | if (*envsizep >= 1000) | ||
853 | fatal("child_set_env: too many env vars," | ||
854 | " skipping: %.100s", name); | ||
852 | (*envsizep) += 50; | 855 | (*envsizep) += 50; |
853 | env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *)); | 856 | env = (*envp) = xrealloc(env, (*envsizep) * sizeof(char *)); |
854 | } | 857 | } |