Skip to content

Commit 5f1e186

Browse files
Adjust mask declaration
1 parent 95af95b commit 5f1e186

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/openssl/stack.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,9 @@ BSSL_NAMESPACE_END
505505
/* use 2-arg sk_*_find for OpenSSL compatibility */ \
506506
OPENSSL_INLINE int sk_##name##_find(const STACK_OF(name) *sk, \
507507
constptrtype p) { \
508-
const size_t mask = 0xffffffffffffffffUL << (sizeof(int) * 8); \
508+
const size_t mask = sizeof(size_t) > sizeof(int) \
509+
? (~((size_t) 0)) << (sizeof(int) * 8) \
510+
: 0; \
509511
size_t out_index = 0; \
510512
int ok = OPENSSL_sk_find((const OPENSSL_STACK *)sk, &out_index, \
511513
(const void *)p, sk_##name##_call_cmp_func); \

0 commit comments

Comments
 (0)