$OpenBSD: patch-lib_sh_getenv_c,v 1.1 2004/07/30 17:02:49 naddy Exp $ --- lib/sh/getenv.c.orig Sun Sep 29 02:38:58 2002 +++ lib/sh/getenv.c Sun Sep 29 02:39:15 2002 @@ -78,7 +78,7 @@ getenv (name) shell_variables will be 0 when this is invoked. We look up the variable in the real environment in that case. */ - for (i = 0, len = strlen (name); environ[i]; i++) + for (i = 0, len = strlen (name); environ && environ[i]; i++) { if ((STREQN (environ[i], name, len)) && (environ[i][len] == '=')) return (environ[i] + len + 1);