diff options
author | deraadt <> | 2019-07-03 03:24:04 +0000 |
---|---|---|
committer | deraadt <> | 2019-07-03 03:24:04 +0000 |
commit | ef84a12d8fc3f2dacb57102d5f84bfb4025a320a (patch) | |
tree | 095ed8468464d046dbf7618376c0a18af76dceba /src/usr.bin/openssl/req.c | |
parent | 88ab3711341dea97a3118b0654ceab1679d5e0a1 (diff) | |
download | openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.tar.gz openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.tar.bz2 openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.zip |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'src/usr.bin/openssl/req.c')
-rw-r--r-- | src/usr.bin/openssl/req.c | 18 |
1 files changed, 9 insertions, 9 deletions
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; |