openssh/openssh-5.1p1-forwards.diff

13 lines
389 B
Diff
Raw Normal View History

--- channels.c
+++ channels.c
@@ -2418,6 +2418,9 @@
const char *host, *addr;
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
+ if (num_adm_permitted_opens >= SSH_MAX_FORWARDS_PER_DIRECTION)
+ fatal("channel_setup_fwd_listener: too many forwards");
+
host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
listen_addr : host_to_connect;
is_client = (type == SSH_CHANNEL_PORT_LISTENER);