summaryrefslogtreecommitdiffstats
path: root/crypto/core_algorithm.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2020-08-31 19:59:43 -0400
committerBenjamin Kaduk <bkaduk@akamai.com>2020-09-02 15:21:11 -0700
commit2b748d722b6ac560d122ea2dcf8d09fe6f03124b (patch)
tree13c4f50f7e76a59d03eb755d790ab72dd1c86d23 /crypto/core_algorithm.c
parent2c0e356ef7fdbb117c9294b57deb67be66db3470 (diff)
Fix use of OPENSSL_realloc in provider
Fix OPENSSL_realloc failure case; `provider->operation_bits` memory is lost when `OPENSSL_realloc()` returns NULL. `operation_bits_sz` is never set to the length of the allocated array. This means that operation_bits is always reallocated in `ossl_provider_set_operation_bit()`, possibly shrinking the array. In addition, it means that the `memset()` always zeros out the whole reallocated array, not just the new part. Also, because `operation_bits_sz` is always zero, the value of `*result` in `ossl_provider_test_operation_bit()` will always be zero. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/12760)
Diffstat (limited to 'crypto/core_algorithm.c')
0 files changed, 0 insertions, 0 deletions