summaryrefslogtreecommitdiffstats
path: root/libexec/ld.so/reallocarray.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2017-01-24 07:48:36 +0000
committerguenther <guenther@openbsd.org>2017-01-24 07:48:36 +0000
commit3b50b772e4ec93984b42a08712bcd018cf6c30db (patch)
tree910108f5cd941453afb831970aaa1bde6e5b4f9d /libexec/ld.so/reallocarray.c
parentUse prime256v1 for tests unless otherwise specified. (diff)
downloadwireguard-openbsd-3b50b772e4ec93984b42a08712bcd018cf6c30db.tar.xz
wireguard-openbsd-3b50b772e4ec93984b42a08712bcd018cf6c30db.zip
On fatal errors, kill ourselves with thrkill(0,9,NULL) instead of
simply exiting, via helper functions _dl_die(), _dl_diedie(), and _dl_oom(). prompted by a complaint from jsing@ ok jsing@ deraadt@
Diffstat (limited to 'libexec/ld.so/reallocarray.c')
-rw-r--r--libexec/ld.so/reallocarray.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libexec/ld.so/reallocarray.c b/libexec/ld.so/reallocarray.c
index 09cd7907b2c..867dc0dc349 100644
--- a/libexec/ld.so/reallocarray.c
+++ b/libexec/ld.so/reallocarray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: reallocarray.c,v 1.1 2014/06/21 08:00:23 otto Exp $ */
+/* $OpenBSD: reallocarray.c,v 1.2 2017/01/24 07:48:37 guenther Exp $ */
/*
* Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
*
@@ -31,9 +31,7 @@ void *
_dl_reallocarray(void *optr, size_t nmemb, size_t size)
{
if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
- nmemb > 0 && SIZE_MAX / nmemb < size) {
- _dl_wrstderr("reallocarray overflow\n");
- _dl_exit(7);
- }
+ nmemb > 0 && SIZE_MAX / nmemb < size)
+ _dl_die("reallocarray overflow");
return _dl_realloc(optr, size * nmemb);
}