summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2015-06-27 22:42:02 +0000
committerdoug <doug@openbsd.org>2015-06-27 22:42:02 +0000
commit65eb85afaadf507b6232bbef218c59affc1320db (patch)
tree4f88c103f972e1061db421f6f6eafdf722d00f43 /lib/libcrypto/cryptlib.c
parentuvm_pmr_get1page() should return psize_t, not int; dhill@ (diff)
downloadwireguard-openbsd-65eb85afaadf507b6232bbef218c59affc1320db.tar.xz
wireguard-openbsd-65eb85afaadf507b6232bbef218c59affc1320db.zip
Fix pointer to unsigned long conversion.
bcook@ notes that this check really only impacted 64-bit Windows. Also, changed the check to be unsigned for consistency. ok bcook@
Diffstat (limited to 'lib/libcrypto/cryptlib.c')
-rw-r--r--lib/libcrypto/cryptlib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c
index dc92ac89fea..896e3d39cfc 100644
--- a/lib/libcrypto/cryptlib.c
+++ b/lib/libcrypto/cryptlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptlib.c,v 1.34 2015/01/22 03:56:27 bcook Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -114,7 +114,9 @@
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
+#include <limits.h>
#include <stdarg.h>
+#include <stdint.h>
#include <string.h>
#include <unistd.h>
@@ -431,9 +433,9 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr)
{
memset(id, 0, sizeof(*id));
id->ptr = ptr;
-#if LONG_MAX >= INTPTR_MAX
+#if ULONG_MAX >= UINTPTR_MAX
/*s u 'ptr' can be embedded in 'val' without loss of uniqueness */
- id->val = (unsigned long)id->ptr;
+ id->val = (uintptr_t)id->ptr;
#else
{
SHA256_CTX ctx;