Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2016-02-07 22:36:04 +0300
committerDavid Benjamin <davidben@google.com>2016-02-12 01:07:56 +0300
commit5ba06897be4fb001113f6e8ea2398538dbbb88f2 (patch)
treef880255fcbb4de630e0827e02ae741d155b9b5c9 /crypto/evp
parent46a4d6d7051775589180e46b3974b2c94dc9f2d7 (diff)
Don't cast |OPENSSL_malloc|/|OPENSSL_realloc| result.
C has implicit conversion of |void *| to other pointer types so these casts are unnecessary. Clean them up to make the code easier to read and to make it easier to find dangerous casts. Change-Id: I26988a672e8ed4d69c75cfbb284413999b475464 Reviewed-on: https://boringssl-review.googlesource.com/7102 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/p_dsa_asn1.c2
-rw-r--r--crypto/evp/p_ec_asn1.c2
-rw-r--r--crypto/evp/p_rsa_asn1.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/crypto/evp/p_dsa_asn1.c b/crypto/evp/p_dsa_asn1.c
index ea75e58c..a876eef4 100644
--- a/crypto/evp/p_dsa_asn1.c
+++ b/crypto/evp/p_dsa_asn1.c
@@ -436,7 +436,7 @@ static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) {
update_buflen(priv_key, &buf_len);
update_buflen(pub_key, &buf_len);
- m = (uint8_t *)OPENSSL_malloc(buf_len + 10);
+ m = OPENSSL_malloc(buf_len + 10);
if (m == NULL) {
OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE);
goto err;
diff --git a/crypto/evp/p_ec_asn1.c b/crypto/evp/p_ec_asn1.c
index e12508db..e093c183 100644
--- a/crypto/evp/p_ec_asn1.c
+++ b/crypto/evp/p_ec_asn1.c
@@ -279,7 +279,7 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) {
OPENSSL_PUT_ERROR(EVP, ERR_R_EC_LIB);
return 0;
}
- ep = (uint8_t *)OPENSSL_malloc(eplen);
+ ep = OPENSSL_malloc(eplen);
if (!ep) {
EC_KEY_set_enc_flags(ec_key, old_flags);
OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE);
diff --git a/crypto/evp/p_rsa_asn1.c b/crypto/evp/p_rsa_asn1.c
index 8556b5ad..70f0b763 100644
--- a/crypto/evp/p_rsa_asn1.c
+++ b/crypto/evp/p_rsa_asn1.c
@@ -216,7 +216,7 @@ static int do_rsa_print(BIO *out, const RSA *rsa, int off,
}
}
- m = (uint8_t *)OPENSSL_malloc(buf_len + 10);
+ m = OPENSSL_malloc(buf_len + 10);
if (m == NULL) {
OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE);
goto err;