From: Peiwei Hu Date: Tue, 24 May 2022 15:10:29 +0000 (+0800) Subject: Fix the check of UI_method_set_ex_data X-Git-Tag: openssl-3.2.0-alpha1~2610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aef2c10f10e0685298008be596c80e148c71a51;p=thirdparty%2Fopenssl.git Fix the check of UI_method_set_ex_data UI_method_set_ex_data returns 0 and 1 instead of negative numbers. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18397) --- diff --git a/crypto/ui/ui_util.c b/crypto/ui/ui_util.c index 54fa43f0cc2..80297969ab1 100644 --- a/crypto/ui/ui_util.c +++ b/crypto/ui/ui_util.c @@ -153,7 +153,7 @@ UI_METHOD *UI_UTIL_wrap_read_pem_callback(pem_password_cb *cb, int rwflag) || UI_method_set_writer(ui_method, ui_write) < 0 || UI_method_set_closer(ui_method, ui_close) < 0 || !RUN_ONCE(&get_index_once, ui_method_data_index_init) - || UI_method_set_ex_data(ui_method, ui_method_data_index, data) < 0) { + || !UI_method_set_ex_data(ui_method, ui_method_data_index, data)) { UI_destroy_method(ui_method); OPENSSL_free(data); return NULL;