mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-26 19:03:48 +01:00
r249408 and r249436 cause a NULL pointer dereference on the CUBIEBOARD
since it doesn't set the kernel envrionment at all. Work around this by making sure kern_envp is non-NULL before dereferencing it.
This commit is contained in:
parent
12087a0769
commit
11c601447d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249570
@ -231,7 +231,7 @@ init_dynamic_kenv(void *data __unused)
|
||||
kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV,
|
||||
M_WAITOK | M_ZERO);
|
||||
i = 0;
|
||||
if (*kern_envp != '\0') {
|
||||
if (kern_envp && *kern_envp != '\0') {
|
||||
for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) {
|
||||
len = strlen(cp) + 1;
|
||||
if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user