From 5910f6cc858828d87dcb8a2fe9b0f5ce8a2a9b89 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Fri, 3 Nov 2006 04:06:17 +0000 Subject: [PATCH] Make sure kern_envp is never NULL. If we don't get a pointer to the environment from the loader, use the static environment. --- sys/ia64/ia64/machdep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index e23ae4b1c33..f3a875e7d2a 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -586,10 +586,11 @@ ia64_init(void) preload_metadata = (caddr_t)bootinfo.bi_modulep; else metadata_missing = 1; - if (envmode == 1) - kern_envp = static_env; - else + + if (envmode == 0 && bootinfo.bi_envp) kern_envp = (caddr_t)bootinfo.bi_envp; + else + kern_envp = static_env; /* * Look at arguments passed to us and compute boothowto.