summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-04-23 10:47:16 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-04-23 10:47:16 +0000
commite82787755e27c6b8105a6ab69d012fb4bf3791c6 (patch)
treec743b86e680e5deeabe6d536cd89e54c408ed12a
parent4fa94abcaef7e5f07b29d73cd05f8844badb4979 (diff)
explain a bit more what's going on for stupid me.
okay otto@
-rw-r--r--lib/libc/stdlib/malloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 5db51d58eed..6c38d6ad87e 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.156 2014/04/23 05:43:25 otto Exp $ */
+/* $OpenBSD: malloc.c,v 1.157 2014/04/23 10:47:15 espie Exp $ */
/*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@@ -1388,6 +1388,9 @@ realloc(void *ptr, size_t size)
}
+/* this is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
+ * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
+ */
#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 4))
void *