summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2016-03-13 18:22:44 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2016-03-13 18:22:44 +0000
commitea66836919b98166b5de5b38d5930590f4ab44cb (patch)
tree0df0099d20d099b56a1228d31cb6f5ce003ddbb9
parent75fa0eb8122706ad17c85d57032522d626af2129 (diff)
check return value for BN_hex2bn in regression tests
-rw-r--r--regress/lib/libcrypto/bn/general/bntest.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/regress/lib/libcrypto/bn/general/bntest.c b/regress/lib/libcrypto/bn/general/bntest.c
index 892206f4620..c6bd788b541 100644
--- a/regress/lib/libcrypto/bn/general/bntest.c
+++ b/regress/lib/libcrypto/bn/general/bntest.c
@@ -721,8 +721,11 @@ test_sqr(BIO *bp, BN_CTX *ctx)
}
/* Regression test for a BN_sqr overflow bug. */
- BN_hex2bn(&a, "80000000000000008000000000000001"
- "FFFFFFFFFFFFFFFE0000000000000000");
+ if (!BN_hex2bn(&a, "80000000000000008000000000000001"
+ "FFFFFFFFFFFFFFFE0000000000000000")) {
+ fprintf(stderr, "BN_hex2bn failed\n");
+ goto err;
+ }
BN_sqr(c, a, ctx);
if (bp != NULL) {
if (!results) {
@@ -743,8 +746,11 @@ test_sqr(BIO *bp, BN_CTX *ctx)
}
/* Regression test for a BN_sqr overflow bug. */
- BN_hex2bn(&a, "80000000000000000000000080000001"
- "FFFFFFFE000000000000000000000000");
+ if (!BN_hex2bn(&a, "80000000000000000000000080000001"
+ "FFFFFFFE000000000000000000000000")) {
+ fprintf(stderr, "BN_hex2bn failed\n");
+ goto err;
+ }
BN_sqr(c, a, ctx);
if (bp != NULL) {
if (!results) {