mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
MIPS: fw: Allow firmware to pass a empty env
fw_getenv will use env entry to determine style of env, however it is legal for firmware to just pass a empty list. Check if first entry exist before running strchr to avoid null pointer dereference. Cc: stable@vger.kernel.org Link: https://github.com/clbr/n64bootloader/issues/5 Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
committed by
Thomas Bogendoerfer
parent
7fb6f7b0af
commit
ee1809ed7b
@@ -53,7 +53,7 @@ char *fw_getenv(char *envname)
|
|||||||
{
|
{
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
|
|
||||||
if (_fw_envp != NULL) {
|
if (_fw_envp != NULL && fw_envp(0) != NULL) {
|
||||||
/*
|
/*
|
||||||
* Return a pointer to the given environment variable.
|
* Return a pointer to the given environment variable.
|
||||||
* YAMON uses "name", "value" pairs, while U-Boot uses
|
* YAMON uses "name", "value" pairs, while U-Boot uses
|
||||||
|
Reference in New Issue
Block a user