From 4fdb8cf7a66cb94037297860a53c51df4b381d59 Mon Sep 17 00:00:00 2001
From: bcook <>
Date: Fri, 18 Sep 2015 13:04:41 +0000
Subject: avoid void * pointer arithmetic

ok miod@
---
 src/lib/libcrypto/ecdh/ech_key.c         | 4 ++--
 src/lib/libssl/src/crypto/ecdh/ech_key.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c
index e695b0b9ad..33ee244499 100644
--- a/src/lib/libcrypto/ecdh/ech_key.c
+++ b/src/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/src/lib/libssl/src/crypto/ecdh/ech_key.c b/src/lib/libssl/src/crypto/ecdh/ech_key.c
index e695b0b9ad..33ee244499 100644
--- a/src/lib/libssl/src/crypto/ecdh/ech_key.c
+++ b/src/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);
-- 
cgit v1.2.3-55-g6feb