diff options
author | 2015-09-18 13:04:41 +0000 | |
---|---|---|
committer | 2015-09-18 13:04:41 +0000 | |
commit | 165a163494768efc5b6a9216b12c2cfeb5939bec (patch) | |
tree | 4a87d59ed4ed63ac5939ba871eb7059bed70b29d | |
parent | Drop the workarounds allowing SMALL_KERNEL (i.e. installation media) to be (diff) | |
download | wireguard-openbsd-165a163494768efc5b6a9216b12c2cfeb5939bec.tar.xz wireguard-openbsd-165a163494768efc5b6a9216b12c2cfeb5939bec.zip |
avoid void * pointer arithmetic
ok miod@
-rw-r--r-- | lib/libcrypto/ecdh/ech_key.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/crypto/ecdh/ech_key.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrypto/ecdh/ech_key.c b/lib/libcrypto/ecdh/ech_key.c index e695b0b9ade..33ee2444998 100644 --- a/lib/libcrypto/ecdh/ech_key.c +++ b/lib/libcrypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.5 2015/09/13 14:11:57 jsing Exp $ */ +/* $OpenBSD: ech_key.c,v 1.6 2015/09/18 13:04:41 bcook Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -187,7 +187,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, } else { /* No KDF, just copy out the key and zero the rest. */ if (outlen > buflen) { - memset(out + buflen, 0, outlen - buflen); + memset((void *)((uintptr_t)out + buflen), 0, outlen - buflen); outlen = buflen; } memcpy(out, buf, outlen); diff --git a/lib/libssl/src/crypto/ecdh/ech_key.c b/lib/libssl/src/crypto/ecdh/ech_key.c index e695b0b9ade..33ee2444998 100644 --- a/lib/libssl/src/crypto/ecdh/ech_key.c +++ b/lib/libssl/src/crypto/ecdh/ech_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ech_key.c,v 1.5 2015/09/13 14:11:57 jsing Exp $ */ +/* $OpenBSD: ech_key.c,v 1.6 2015/09/18 13:04:41 bcook Exp $ */ /* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * @@ -187,7 +187,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, } else { /* No KDF, just copy out the key and zero the rest. */ if (outlen > buflen) { - memset(out + buflen, 0, outlen - buflen); + memset((void *)((uintptr_t)out + buflen), 0, outlen - buflen); outlen = buflen; } memcpy(out, buf, outlen); |