Ignore kenv strings which overflow the room we have, rather than pretend

we have room for them.
This commit is contained in:
Poul-Henning Kamp 2006-03-09 09:29:41 +00:00
parent 2d7994d97e
commit c8d7706e75
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156482

View File

@ -211,7 +211,12 @@ init_dynamic_kenv(void *data __unused)
for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) {
len = strlen(cp) + 1;
kenvp[i] = malloc(len, M_KENV, M_WAITOK);
strcpy(kenvp[i++], cp);
if (i < KENV_SIZE)
strcpy(kenvp[i++], cp);
else
printf(
"WARNING: too many kenv strings, ignoring %s\n",
cp);
}
kenvp[i] = NULL;