summaryrefslogtreecommitdiff
path: root/mux.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-07-18 16:12:44 +1000
committerDamien Miller <djm@mindrot.org>2013-07-18 16:12:44 +1000
commitce98654674648fb7d58f73edf6aa398656a2dba4 (patch)
tree0eaf824f5ec795de2204e800d6e1d74d2c905ac8 /mux.c
parent0d02c3e10e1ed16d6396748375a133d348127a2a (diff)
- djm@cvs.openbsd.org 2013/07/12 00:19:59
[auth-options.c auth-rsa.c bufaux.c buffer.h channels.c hostfile.c] [hostfile.h mux.c packet.c packet.h roaming_common.c serverloop.c] fix pointer-signedness warnings from clang/llvm-3.3; "seems nice" deraadt@
Diffstat (limited to 'mux.c')
-rw-r--r--mux.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/mux.c b/mux.c
index 314ee8cd2..882fa61b5 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mux.c,v 1.43 2013/06/05 02:07:29 dtucker Exp $ */ 1/* $OpenBSD: mux.c,v 1.44 2013/07/12 00:19:58 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -630,19 +630,22 @@ process_mux_open_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r)
630 Forward fwd; 630 Forward fwd;
631 char *fwd_desc = NULL; 631 char *fwd_desc = NULL;
632 u_int ftype; 632 u_int ftype;
633 u_int lport, cport;
633 int i, ret = 0, freefwd = 1; 634 int i, ret = 0, freefwd = 1;
634 635
635 fwd.listen_host = fwd.connect_host = NULL; 636 fwd.listen_host = fwd.connect_host = NULL;
636 if (buffer_get_int_ret(&ftype, m) != 0 || 637 if (buffer_get_int_ret(&ftype, m) != 0 ||
637 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || 638 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
638 buffer_get_int_ret(&fwd.listen_port, m) != 0 || 639 buffer_get_int_ret(&lport, m) != 0 ||
639 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL || 640 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL ||
640 buffer_get_int_ret(&fwd.connect_port, m) != 0) { 641 buffer_get_int_ret(&cport, m) != 0 ||
642 lport > 65535 || cport > 65535) {
641 error("%s: malformed message", __func__); 643 error("%s: malformed message", __func__);
642 ret = -1; 644 ret = -1;
643 goto out; 645 goto out;
644 } 646 }
645 647 fwd.listen_port = lport;
648 fwd.connect_port = cport;
646 if (*fwd.listen_host == '\0') { 649 if (*fwd.listen_host == '\0') {
647 free(fwd.listen_host); 650 free(fwd.listen_host);
648 fwd.listen_host = NULL; 651 fwd.listen_host = NULL;
@@ -778,17 +781,21 @@ process_mux_close_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r)
778 const char *error_reason = NULL; 781 const char *error_reason = NULL;
779 u_int ftype; 782 u_int ftype;
780 int i, listen_port, ret = 0; 783 int i, listen_port, ret = 0;
784 u_int lport, cport;
781 785
782 fwd.listen_host = fwd.connect_host = NULL; 786 fwd.listen_host = fwd.connect_host = NULL;
783 if (buffer_get_int_ret(&ftype, m) != 0 || 787 if (buffer_get_int_ret(&ftype, m) != 0 ||
784 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || 788 (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL ||
785 buffer_get_int_ret(&fwd.listen_port, m) != 0 || 789 buffer_get_int_ret(&lport, m) != 0 ||
786 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL || 790 (fwd.connect_host = buffer_get_string_ret(m, NULL)) == NULL ||
787 buffer_get_int_ret(&fwd.connect_port, m) != 0) { 791 buffer_get_int_ret(&cport, m) != 0 ||
792 lport > 65535 || cport > 65535) {
788 error("%s: malformed message", __func__); 793 error("%s: malformed message", __func__);
789 ret = -1; 794 ret = -1;
790 goto out; 795 goto out;
791 } 796 }
797 fwd.listen_port = lport;
798 fwd.connect_port = cport;
792 799
793 if (*fwd.listen_host == '\0') { 800 if (*fwd.listen_host == '\0') {
794 free(fwd.listen_host); 801 free(fwd.listen_host);