Skip to content

Commit 2f78a2a

Browse files
committed
upstream commit
fix some -Wpointer-sign warnings in the new mux proxy; ok markus@ Upstream-ID: b1ba7b3769fbc6b7f526792a215b0197f5e55dfd
1 parent ca71c36 commit 2f78a2a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: channels.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: channels.c,v 1.354 2016/09/30 09:19:13 markus Exp $ */
1+
/* $OpenBSD: channels.c,v 1.355 2016/09/30 20:24:46 djm Exp $ */
22
/*
33
* Author: Tatu Ylonen <[email protected]>
44
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
@@ -2472,7 +2472,8 @@ channel_proxy_downstream(Channel *downstream)
24722472
char *ctype = NULL, *listen_host = NULL;
24732473
u_char type;
24742474
size_t have;
2475-
int ret = -1, r, id, remote_id, listen_port, idx;
2475+
int ret = -1, r, idx;
2476+
u_int id, remote_id, listen_port;
24762477

24772478
/* sshbuf_dump(&downstream->input, stderr); */
24782479
if ((r = sshbuf_get_string_direct(&downstream->input, &cp, &have))
@@ -2563,14 +2564,19 @@ channel_proxy_downstream(Channel *downstream)
25632564
error("%s: parse error %s", __func__, ssh_err(r));
25642565
goto out;
25652566
}
2567+
if (listen_port > 65535) {
2568+
error("%s: tcpip-forward for %s: bad port %u",
2569+
__func__, listen_host, listen_port);
2570+
goto out;
2571+
}
25662572
/* Record that connection to this host/port is permitted. */
25672573
permitted_opens = xreallocarray(permitted_opens,
25682574
num_permitted_opens + 1, sizeof(*permitted_opens));
25692575
idx = num_permitted_opens++;
25702576
permitted_opens[idx].host_to_connect = xstrdup("<mux>");
25712577
permitted_opens[idx].port_to_connect = -1;
25722578
permitted_opens[idx].listen_host = listen_host;
2573-
permitted_opens[idx].listen_port = listen_port;
2579+
permitted_opens[idx].listen_port = (int)listen_port;
25742580
permitted_opens[idx].downstream = downstream;
25752581
listen_host = NULL;
25762582
break;

0 commit comments

Comments
 (0)