summaryrefslogtreecommitdiff
path: root/libexec/ld.so/reallocarray.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2017-01-24 07:48:38 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2017-01-24 07:48:38 +0000
commitc66416e633310f06dfbeaa655d3e2826d4c42dc6 (patch)
tree871022ef5bc45fdadb9027dd35c237840f023803 /libexec/ld.so/reallocarray.c
parenta25395adead1f5541203d945e1c673202a0c6395 (diff)
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);
}