summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPavel Stetsuk <pstetsuk@gmail.com>2023-09-14 23:05:49 +0300
committerTomas Mraz <tomas@openssl.org>2023-10-18 16:40:09 +0200
commit31dcd762ee6718238b433d752a632a2b2ea3f345 (patch)
tree0a8dc3f0ff92cf730d7559ef6a710701afdc8f2c /crypto
parenta6ed37c2e2c50e93937e4ea3271a8af96e0303de (diff)
fix: LINEAR search doesn't work properly (if CHARSET_EBCDIC is defined)
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22108) (cherry picked from commit a47fc4ed401da4e2d84e035cc4add566e85b03d0)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/objects/obj_dat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index 341f0b20c7..882a9455f8 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -687,13 +687,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