diff options
author | Paul Yang <paulyang.inf@gmail.com> | 2017-06-22 18:52:29 +0800 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-06-26 15:40:16 +0200 |
commit | edea42c602854c902b7909a150cd2412d7b8f215 (patch) | |
tree | b0e97a08a199df553af3dd0f6144dda7d77538e5 /crypto/bn/bn_sqr.c | |
parent | 9e1d5e8dff693cb2b658f66db4f10709d8364690 (diff) |
Change to check last return value of BN_CTX_get
To make it consistent in the code base
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/3749)
Diffstat (limited to 'crypto/bn/bn_sqr.c')
-rw-r--r-- | crypto/bn/bn_sqr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bn_sqr.c b/crypto/bn/bn_sqr.c index 44e7332acf..4e8df0e3ec 100644 --- a/crypto/bn/bn_sqr.c +++ b/crypto/bn/bn_sqr.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -32,7 +32,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) BN_CTX_start(ctx); rr = (a != r) ? r : BN_CTX_get(ctx); tmp = BN_CTX_get(ctx); - if (!rr || !tmp) + if (rr == NULL || tmp == NULL) goto err; max = 2 * al; /* Non-zero (from above) */ |