mirror of
https://github.com/openssl/openssl.git
synced 2026-06-06 20:18:09 +00:00
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)
This commit is contained in:
committed by
Tomas Mraz
parent
21b98da9d8
commit
a47fc4ed40
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user