summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
authortb <>2026-01-14 17:43:49 +0000
committertb <>2026-01-14 17:43:49 +0000
commitf3b7e1f8d7abce09c15e715e5f167b6f10d127de (patch)
tree3b14bbdf430d1bbfb21ce0f89066574f1394c9d6 /src/lib/libcrypto
parent9061b4381d8ab99d1f141ef03cc52f45c2e7a3bd (diff)
downloadopenbsd-f3b7e1f8d7abce09c15e715e5f167b6f10d127de.tar.gz
openbsd-f3b7e1f8d7abce09c15e715e5f167b6f10d127de.tar.bz2
openbsd-f3b7e1f8d7abce09c15e715e5f167b6f10d127de.zip
stack.c: avoid arithmetic on pointers to voidHEADmaster
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
Diffstat (limited to 'src/lib/libcrypto')
-rw-r--r--src/lib/libcrypto/stack/stack.c4
1 files changed, 2 insertions, 2 deletions
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 @@
1/* $OpenBSD: stack.c,v 1.34 2025/12/21 07:35:11 tb Exp $ */ 1/* $OpenBSD: stack.c,v 1.35 2026/01/14 17:43:49 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -201,7 +201,7 @@ static const void *
201obj_bsearch_ex(const void *key, const void *base_, int num, int size, 201obj_bsearch_ex(const void *key, const void *base_, int num, int size,
202 int (*cmp)(const void *, const void *)) 202 int (*cmp)(const void *, const void *))
203{ 203{
204 const void *base = base_; 204 const char *base = base_;
205 int l, h, i, c; 205 int l, h, i, c;
206 206
207 l = 0; 207 l = 0;