From: Abel Tom Date: Wed, 13 May 2026 16:18:45 +0000 (+0200) Subject: OBJ_bsearch_ex_(): Fix const qualifier warning with CHARSET_EBCDIC X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=413eff874dd7ea34dfaef821f8e81983cd3c6069;p=thirdparty%2Fopenssl.git OBJ_bsearch_ex_(): Fix const qualifier warning with CHARSET_EBCDIC Fixes #31161 When building with CHARSET_EBCDIC defined,the compiler warns about discarding the 'const' qualifier when assigning from base_[i * size] to the non-const pointer p1: `warning: assignment discards 'const' qualifier from pointer target type` Change p1 from 'char *' to 'const char *' to maintain const-correctness since the data being pointed to should not be modified through this pointer. Additionally, remove the unused variables l and h that were left over from a previous implementation of the fallback linear search. These variables served no purpose and only generated unused variable warnings. Reviewed-by: Frederik Wedel-Heinen Reviewed-by: Kurt Roeckx Reviewed-by: Tomas Mraz MergeDate: Mon May 18 11:07:53 2026 (Merged from https://github.com/openssl/openssl/pull/31173) --- diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 8bb029ac32e..8ab06349163 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -616,8 +616,8 @@ 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; + int i = 0, c = 0; + const char *p1; for (i = 0; i < num; ++i) { p1 = &(base_[i * size]);