From e00c0bc864ef6a6ee49bd4f6e9d4d35314bb2985 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 11 Sep 1996 03:04:43 +0000 Subject: [PATCH] only support MALLOC_OPTIONS for non-setuid --- lib/libc/stdlib/malloc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index e82a5953fdb..bdae6f00a32 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.9 1996/09/06 16:14:36 tholo Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.10 1996/09/11 03:04:43 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -526,8 +526,9 @@ malloc_init () malloc_junk = 1; #endif /* EXTRA_SANITY */ - for (p=getenv("MALLOC_OPTIONS"); p && *p; p++) { - switch (*p) { + if (issetugid() == 0) { + for (p=getenv("MALLOC_OPTIONS"); p && *p; p++) { + switch (*p) { case 'a': malloc_abort = 0; break; case 'A': malloc_abort = 1; break; #ifdef MALLOC_STATS @@ -544,6 +545,7 @@ malloc_init () wrtwarning("(Init): Unknown char in MALLOC_OPTIONS\n"); p = 0; break; + } } } -- 2.20.1