summaryrefslogtreecommitdiffstats
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-06-26 19:14:43 +1000
committerDamien Miller <djm@mindrot.org>2002-06-26 19:14:43 +1000
commit9403aa2f79cac6e1565324d5d33d572f62932187 (patch)
tree00aa0bbb4afdb6a21d125b87f3e3d44e987de121 /channels.c
parent468cd716a54ac1fb85d24e6d270d824e460267b2 (diff)
- markus@cvs.openbsd.org 2002/06/26 08:55:02
[channels.c] limit # of channels to 10000
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels.c b/channels.c
index c22e5695..29eaee7c 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.178 2002/06/24 14:33:27 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.179 2002/06/26 08:55:02 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -229,6 +229,9 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
/* There are no free slots. Take last+1 slot and expand the array. */
found = channels_alloc;
channels_alloc += 10;
+ if (channels_alloc > 10000)
+ fatal("channel_new: internal error: channels_alloc %d "
+ "too big.", channels_alloc);
debug2("channel: expanding %d", channels_alloc);
channels = xrealloc(channels, channels_alloc * sizeof(Channel *));
for (i = found; i < channels_alloc; i++)