From: Pavel Stetsuk Date: Thu, 14 Sep 2023 20:05:49 +0000 (+0300) Subject: fix: LINEAR search doesn't work properly (if CHARSET_EBCDIC is defined) X-Git-Tag: openssl-3.2.0-beta1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a47fc4ed401da4e2d84e035cc4add566e85b03d0;p=thirdparty%2Fopenssl.git fix: LINEAR search doesn't work properly (if CHARSET_EBCDIC is defined) CLA: trivial Reviewed-by: Paul Dale Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22108) --- diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 2c1a288167e..209059aa7ce 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -677,13 +677,14 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, if (p == NULL) { const char *base_ = base; int l, h, i = 0, c = 0; + char *p1; for (i = 0; i < num; ++i) { - p = &(base_[i * size]); - c = (*cmp) (key, p); + p1 = &(base_[i * size]); + c = (*cmp) (key, p1); if (c == 0 || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH))) - return p; + return p1; } } #endif