From f3b7e1f8d7abce09c15e715e5f167b6f10d127de Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 14 Jan 2026 17:43:49 +0000 Subject: stack.c: avoid arithmetic on pointers to void In stack.c r1.34 I converted one 'char *' too many to 'void *', thereby relying on a gcc/clang extension which interprets the fictional void type as a type of size 1 (that's what the stack code wants, fortunately). As pointed out in the link below, -Wpointer-arith would have caught this: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html MSVC flags this as follows: D:\a\portable\portable\crypto\stack\stack.c(211,23): error C2036: 'const void *': unknown size [D:\a\portable\portable\build\crypto\crypto_obj.vcxproj]. Pull in workaround from the portable repo which undoes the char * -> void * conversion. ok jsing millert --- src/lib/libcrypto/stack/stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/stack/stack.c') diff --git a/src/lib/libcrypto/stack/stack.c b/src/lib/libcrypto/stack/stack.c index ed18688a31..dd9d8b8395 100644 --- a/src/lib/libcrypto/stack/stack.c +++ b/src/lib/libcrypto/stack/stack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stack.c,v 1.34 2025/12/21 07:35:11 tb Exp $ */ +/* $OpenBSD: stack.c,v 1.35 2026/01/14 17:43:49 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -201,7 +201,7 @@ static const void * obj_bsearch_ex(const void *key, const void *base_, int num, int size, int (*cmp)(const void *, const void *)) { - const void *base = base_; + const char *base = base_; int l, h, i, c; l = 0; -- cgit v1.2.3-55-g6feb