Make sure config list is not empty before trying to access it
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 40s
Builds / ExectOS (i686) (push) Successful in 28s

This commit is contained in:
Rafal Kupiec 2023-12-21 20:02:02 +01:00
parent 093ef010c8
commit 782e6e3987
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -30,22 +30,26 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName)
/* Get config entry name length */
Length = RtlWideStringLength(ConfigName, 0);
/* Iterate through config entries */
ConfigListEntry = BlpConfig->Flink;
while(ConfigListEntry != BlpConfig)
/* Make sure config list is not empty */
if(BlpConfig != NULL)
{
/* Get config entry */
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
/* Check if requested configuration found */
if(RtlCompareWideStringInsensitive(ConfigEntry->Name, ConfigName, Length) == 0)
/* Iterate through config entries */
ConfigListEntry = BlpConfig->Flink;
while(ConfigListEntry != BlpConfig)
{
/* Return config value */
return ConfigEntry->Value;
}
/* Get config entry */
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
/* Move to the next config entry */
ConfigListEntry = ConfigListEntry->Flink;
/* Check if requested configuration found */
if(RtlCompareWideStringInsensitive(ConfigEntry->Name, ConfigName, Length) == 0)
{
/* Return config value */
return ConfigEntry->Value;
}
/* Move to the next config entry */
ConfigListEntry = ConfigListEntry->Flink;
}
}
/* Config entry not found, return NULL */