diff options
Diffstat (limited to 'src/usr.bin/nc/socks.c')
-rw-r--r-- | src/usr.bin/nc/socks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/usr.bin/nc/socks.c b/src/usr.bin/nc/socks.c index 856c3e7446..39e4331be3 100644 --- a/src/usr.bin/nc/socks.c +++ b/src/usr.bin/nc/socks.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: socks.c,v 1.27 2019/01/10 12:44:54 mestre Exp $ */ | 1 | /* $OpenBSD: socks.c,v 1.28 2019/07/03 03:24:02 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. | 4 | * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. |
@@ -334,7 +334,7 @@ socks_connect(const char *host, const char *port, | |||
334 | "CONNECT %s:%d HTTP/1.0\r\n", | 334 | "CONNECT %s:%d HTTP/1.0\r\n", |
335 | host, ntohs(serverport)); | 335 | host, ntohs(serverport)); |
336 | } | 336 | } |
337 | if (r == -1 || (size_t)r >= sizeof(buf)) | 337 | if (r < 0 || (size_t)r >= sizeof(buf)) |
338 | errx(1, "hostname too long"); | 338 | errx(1, "hostname too long"); |
339 | r = strlen(buf); | 339 | r = strlen(buf); |
340 | 340 | ||
@@ -357,7 +357,7 @@ socks_connect(const char *host, const char *port, | |||
357 | errx(1, "Proxy username/password too long"); | 357 | errx(1, "Proxy username/password too long"); |
358 | r = snprintf(buf, sizeof(buf), "Proxy-Authorization: " | 358 | r = snprintf(buf, sizeof(buf), "Proxy-Authorization: " |
359 | "Basic %s\r\n", resp); | 359 | "Basic %s\r\n", resp); |
360 | if (r == -1 || (size_t)r >= sizeof(buf)) | 360 | if (r < 0 || (size_t)r >= sizeof(buf)) |
361 | errx(1, "Proxy auth response too long"); | 361 | errx(1, "Proxy auth response too long"); |
362 | r = strlen(buf); | 362 | r = strlen(buf); |
363 | if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) | 363 | if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) |