diff options
Diffstat (limited to 'src/usr.bin')
-rw-r--r-- | src/usr.bin/nc/socks.c | 6 | ||||
-rw-r--r-- | src/usr.bin/openssl/apps.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/ca.c | 4 | ||||
-rw-r--r-- | src/usr.bin/openssl/req.c | 18 | ||||
-rw-r--r-- | src/usr.bin/openssl/s_time.c | 4 |
5 files changed, 18 insertions, 18 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) |
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 47e21265af..39ce7a5f34 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apps.c,v 1.52 2019/06/28 13:35:02 deraadt Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.53 2019/07/03 03:24:02 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -1328,7 +1328,7 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, | |||
1328 | else | 1328 | else |
1329 | n = snprintf(serialpath, sizeof serialpath, "%s.%s", | 1329 | n = snprintf(serialpath, sizeof serialpath, "%s.%s", |
1330 | serialfile, suffix); | 1330 | serialfile, suffix); |
1331 | if (n == -1 || n >= sizeof(serialpath)) { | 1331 | if (n < 0 || n >= sizeof(serialpath)) { |
1332 | BIO_printf(bio_err, "serial too long\n"); | 1332 | BIO_printf(bio_err, "serial too long\n"); |
1333 | goto err; | 1333 | goto err; |
1334 | } | 1334 | } |
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c index 2e79849572..ac183f28bf 100644 --- a/src/usr.bin/openssl/ca.c +++ b/src/usr.bin/openssl/ca.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ca.c,v 1.26 2018/02/07 05:47:55 jsing Exp $ */ | 1 | /* $OpenBSD: ca.c,v 1.27 2019/07/03 03:24:02 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1109,7 +1109,7 @@ ca_main(int argc, char **argv) | |||
1109 | k = snprintf(pempath, sizeof(pempath), | 1109 | k = snprintf(pempath, sizeof(pempath), |
1110 | "%s/%s.pem", outdir, serialstr); | 1110 | "%s/%s.pem", outdir, serialstr); |
1111 | free(serialstr); | 1111 | free(serialstr); |
1112 | if (k == -1 || k >= sizeof(pempath)) { | 1112 | if (k < 0 || k >= sizeof(pempath)) { |
1113 | BIO_printf(bio_err, | 1113 | BIO_printf(bio_err, |
1114 | "certificate file name too long\n"); | 1114 | "certificate file name too long\n"); |
1115 | goto err; | 1115 | goto err; |
diff --git a/src/usr.bin/openssl/req.c b/src/usr.bin/openssl/req.c index c5cae4df89..6b7dfb98b9 100644 --- a/src/usr.bin/openssl/req.c +++ b/src/usr.bin/openssl/req.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: req.c,v 1.15 2018/02/07 05:47:55 jsing Exp $ */ | 1 | /* $OpenBSD: req.c,v 1.16 2019/07/03 03:24:02 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1030,7 +1030,7 @@ prompt_info(X509_REQ * req, | |||
1030 | if ((nid = OBJ_txt2nid(type)) == NID_undef) | 1030 | if ((nid = OBJ_txt2nid(type)) == NID_undef) |
1031 | goto start; | 1031 | goto start; |
1032 | ret = snprintf(buf, sizeof buf, "%s_default", v->name); | 1032 | ret = snprintf(buf, sizeof buf, "%s_default", v->name); |
1033 | if (ret == -1 || ret >= sizeof(buf)) { | 1033 | if (ret < 0 || ret >= sizeof(buf)) { |
1034 | BIO_printf(bio_err, "Name '%s' too long for default\n", | 1034 | BIO_printf(bio_err, "Name '%s' too long for default\n", |
1035 | v->name); | 1035 | v->name); |
1036 | return 0; | 1036 | return 0; |
@@ -1040,7 +1040,7 @@ prompt_info(X509_REQ * req, | |||
1040 | def = ""; | 1040 | def = ""; |
1041 | } | 1041 | } |
1042 | ret = snprintf(buf, sizeof buf, "%s_value", v->name); | 1042 | ret = snprintf(buf, sizeof buf, "%s_value", v->name); |
1043 | if (ret == -1 || ret >= sizeof(buf)) { | 1043 | if (ret < 0 || ret >= sizeof(buf)) { |
1044 | BIO_printf(bio_err, "Name '%s' too long for value\n", | 1044 | BIO_printf(bio_err, "Name '%s' too long for value\n", |
1045 | v->name); | 1045 | v->name); |
1046 | return 0; | 1046 | return 0; |
@@ -1050,7 +1050,7 @@ prompt_info(X509_REQ * req, | |||
1050 | value = NULL; | 1050 | value = NULL; |
1051 | } | 1051 | } |
1052 | ret = snprintf(buf, sizeof buf, "%s_min", v->name); | 1052 | ret = snprintf(buf, sizeof buf, "%s_min", v->name); |
1053 | if (ret == -1 || ret >= sizeof(buf)) { | 1053 | if (ret < 0 || ret >= sizeof(buf)) { |
1054 | BIO_printf(bio_err, "Name '%s' too long for min\n", | 1054 | BIO_printf(bio_err, "Name '%s' too long for min\n", |
1055 | v->name); | 1055 | v->name); |
1056 | return 0; | 1056 | return 0; |
@@ -1060,7 +1060,7 @@ prompt_info(X509_REQ * req, | |||
1060 | n_min = -1; | 1060 | n_min = -1; |
1061 | } | 1061 | } |
1062 | ret = snprintf(buf, sizeof buf, "%s_max", v->name); | 1062 | ret = snprintf(buf, sizeof buf, "%s_max", v->name); |
1063 | if (ret == -1 || ret >= sizeof(buf)) { | 1063 | if (ret < 0 || ret >= sizeof(buf)) { |
1064 | BIO_printf(bio_err, "Name '%s' too long for max\n", | 1064 | BIO_printf(bio_err, "Name '%s' too long for max\n", |
1065 | v->name); | 1065 | v->name); |
1066 | return 0; | 1066 | return 0; |
@@ -1098,7 +1098,7 @@ start2: for (;;) { | |||
1098 | if ((nid = OBJ_txt2nid(type)) == NID_undef) | 1098 | if ((nid = OBJ_txt2nid(type)) == NID_undef) |
1099 | goto start2; | 1099 | goto start2; |
1100 | ret = snprintf(buf, sizeof buf, "%s_default", type); | 1100 | ret = snprintf(buf, sizeof buf, "%s_default", type); |
1101 | if (ret == -1 || ret >= sizeof(buf)) { | 1101 | if (ret < 0 || ret >= sizeof(buf)) { |
1102 | BIO_printf(bio_err, "Name '%s' too long for default\n", | 1102 | BIO_printf(bio_err, "Name '%s' too long for default\n", |
1103 | v->name); | 1103 | v->name); |
1104 | return 0; | 1104 | return 0; |
@@ -1109,7 +1109,7 @@ start2: for (;;) { | |||
1109 | def = ""; | 1109 | def = ""; |
1110 | } | 1110 | } |
1111 | ret = snprintf(buf, sizeof buf, "%s_value", type); | 1111 | ret = snprintf(buf, sizeof buf, "%s_value", type); |
1112 | if (ret == -1 || ret >= sizeof(buf)) { | 1112 | if (ret < 0 || ret >= sizeof(buf)) { |
1113 | BIO_printf(bio_err, "Name '%s' too long for value\n", | 1113 | BIO_printf(bio_err, "Name '%s' too long for value\n", |
1114 | v->name); | 1114 | v->name); |
1115 | return 0; | 1115 | return 0; |
@@ -1120,7 +1120,7 @@ start2: for (;;) { | |||
1120 | value = NULL; | 1120 | value = NULL; |
1121 | } | 1121 | } |
1122 | ret = snprintf(buf, sizeof buf, "%s_min", type); | 1122 | ret = snprintf(buf, sizeof buf, "%s_min", type); |
1123 | if (ret == -1 || ret >= sizeof(buf)) { | 1123 | if (ret < 0 || ret >= sizeof(buf)) { |
1124 | BIO_printf(bio_err, "Name '%s' too long for min\n", | 1124 | BIO_printf(bio_err, "Name '%s' too long for min\n", |
1125 | v->name); | 1125 | v->name); |
1126 | return 0; | 1126 | return 0; |
@@ -1130,7 +1130,7 @@ start2: for (;;) { | |||
1130 | n_min = -1; | 1130 | n_min = -1; |
1131 | } | 1131 | } |
1132 | ret = snprintf(buf, sizeof buf, "%s_max", type); | 1132 | ret = snprintf(buf, sizeof buf, "%s_max", type); |
1133 | if (ret == -1 || ret >= sizeof(buf)) { | 1133 | if (ret < 0 || ret >= sizeof(buf)) { |
1134 | BIO_printf(bio_err, "Name '%s' too long for max\n", | 1134 | BIO_printf(bio_err, "Name '%s' too long for max\n", |
1135 | v->name); | 1135 | v->name); |
1136 | return 0; | 1136 | return 0; |
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index 1506ca356a..3263a2dff3 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_time.c,v 1.32 2018/09/17 15:37:35 cheloha Exp $ */ | 1 | /* $OpenBSD: s_time.c,v 1.33 2019/07/03 03:24:02 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -377,7 +377,7 @@ run_test(SSL *scon) | |||
377 | if (s_time_config.www_path != NULL) { | 377 | if (s_time_config.www_path != NULL) { |
378 | retval = snprintf(buf, sizeof buf, | 378 | retval = snprintf(buf, sizeof buf, |
379 | "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); | 379 | "GET %s HTTP/1.0\r\n\r\n", s_time_config.www_path); |
380 | if (retval == -1 || retval >= sizeof buf) { | 380 | if (retval < 0 || retval >= sizeof buf) { |
381 | fprintf(stderr, "URL too long\n"); | 381 | fprintf(stderr, "URL too long\n"); |
382 | return 0; | 382 | return 0; |
383 | } | 383 | } |