summaryrefslogtreecommitdiff
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
parent468cd716a54ac1fb85d24e6d270d824e460267b2 (diff)
- markus@cvs.openbsd.org 2002/06/26 08:55:02
[channels.c] limit # of channels to 10000
-rw-r--r--ChangeLog5
-rw-r--r--channels.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index af372d8f2..f9db38e61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,9 @@
42 - markus@cvs.openbsd.org 2002/06/26 08:54:18 42 - markus@cvs.openbsd.org 2002/06/26 08:54:18
43 [buffer.c] 43 [buffer.c]
44 limit append to 1MB and buffers to 10MB 44 limit append to 1MB and buffers to 10MB
45 - markus@cvs.openbsd.org 2002/06/26 08:55:02
46 [channels.c]
47 limit # of channels to 10000
45 48
4620020625 4920020625
47 - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh 50 - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
@@ -1141,4 +1144,4 @@
1141 - (stevesk) entropy.c: typo in debug message 1144 - (stevesk) entropy.c: typo in debug message
1142 - (djm) ssh-keygen -i needs seeded RNG; report from markus@ 1145 - (djm) ssh-keygen -i needs seeded RNG; report from markus@
1143 1146
1144$Id: ChangeLog,v 1.2291 2002/06/26 09:14:25 djm Exp $ 1147$Id: ChangeLog,v 1.2292 2002/06/26 09:14:43 djm Exp $
diff --git a/channels.c b/channels.c
index c22e5695c..29eaee7c4 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.178 2002/06/24 14:33:27 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.179 2002/06/26 08:55:02 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -229,6 +229,9 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
229 /* There are no free slots. Take last+1 slot and expand the array. */ 229 /* There are no free slots. Take last+1 slot and expand the array. */
230 found = channels_alloc; 230 found = channels_alloc;
231 channels_alloc += 10; 231 channels_alloc += 10;
232 if (channels_alloc > 10000)
233 fatal("channel_new: internal error: channels_alloc %d "
234 "too big.", channels_alloc);
232 debug2("channel: expanding %d", channels_alloc); 235 debug2("channel: expanding %d", channels_alloc);
233 channels = xrealloc(channels, channels_alloc * sizeof(Channel *)); 236 channels = xrealloc(channels, channels_alloc * sizeof(Channel *));
234 for (i = found; i < channels_alloc; i++) 237 for (i = found; i < channels_alloc; i++)