diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2021-11-29 20:51:58 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2021-11-29 20:51:58 +0100 |
| commit | 6e3e95a9da9458ddf0874b4bd1c8ce6b47fcef27 (patch) | |
| tree | 6e3667709d99f857d90b9831426f6a32ee70d113 /src/openvpn/socks.c | |
| parent | b29f419d68b26b75a44e3ac00748875f1003b900 (diff) | |
| parent | f2b3dda12a731c2e0971cb7889728edaf23f6cb0 (diff) | |
Merge branch 'upstream' into develop
Diffstat (limited to 'src/openvpn/socks.c')
| -rw-r--r-- | src/openvpn/socks.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c index 57f0cee..71f82b2 100644 --- a/src/openvpn/socks.c +++ b/src/openvpn/socks.c @@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> + * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -312,7 +312,7 @@ recv_socks_reply(socket_descriptor_t sd, char atyp = '\0'; int alen = 0; int len = 0; - char buf[22]; + char buf[270]; /* 4 + alen(max 256) + 2 */ const int timeout_sec = 5; if (addr != NULL) @@ -381,7 +381,10 @@ recv_socks_reply(socket_descriptor_t sd, break; case '\x03': /* DOMAINNAME */ - alen = (unsigned char) c; + /* RFC 1928, section 5: 1 byte length, <n> bytes name, + * so the total "address length" is (length+1) + */ + alen = (unsigned char) c + 1; break; case '\x04': /* IP V6 */ @@ -451,7 +454,7 @@ establish_socks_proxy_passthru(struct socks_proxy_info *p, const char *servname, /* openvpn server port */ volatile int *signal_received) { - char buf[128]; + char buf[270]; size_t len; if (!socks_handshake(p, sd, signal_received)) |
