mirror of
https://github.com/openssl/openssl.git
synced 2024-12-15 06:01:37 +08:00
3f6a12a07f
The OPENSSL_memdup() is not always success, as the potential failure of the allocation. Then the '*pptr'could be NULL pointer but the ui_dup_method_data() will still return 1. In CRYPTO_dup_ex_data(), the 'storage[i]->dup_func' will not fail and 'ptr' will be used in CRYPTO_set_ex_data(). Also, if '*pptr' is NULL, I think it should also return 0 to tell the caller that the duplication fails in order to prevernt using the NULL pointer. Therefore, it should be better to add the check and return 1 only if the duplication succeed. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17582) |
||
---|---|---|
.. | ||
build.info | ||
ui_err.c | ||
ui_lib.c | ||
ui_local.h | ||
ui_null.c | ||
ui_openssl.c | ||
ui_util.c |