Make sure config list is not empty before trying to access it
This commit is contained in:
parent
093ef010c8
commit
782e6e3987
@ -30,22 +30,26 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName)
|
|||||||
/* Get config entry name length */
|
/* Get config entry name length */
|
||||||
Length = RtlWideStringLength(ConfigName, 0);
|
Length = RtlWideStringLength(ConfigName, 0);
|
||||||
|
|
||||||
/* Iterate through config entries */
|
/* Make sure config list is not empty */
|
||||||
ConfigListEntry = BlpConfig->Flink;
|
if(BlpConfig != NULL)
|
||||||
while(ConfigListEntry != BlpConfig)
|
|
||||||
{
|
{
|
||||||
/* Get config entry */
|
/* Iterate through config entries */
|
||||||
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
ConfigListEntry = BlpConfig->Flink;
|
||||||
|
while(ConfigListEntry != BlpConfig)
|
||||||
/* Check if requested configuration found */
|
|
||||||
if(RtlCompareWideStringInsensitive(ConfigEntry->Name, ConfigName, Length) == 0)
|
|
||||||
{
|
{
|
||||||
/* Return config value */
|
/* Get config entry */
|
||||||
return ConfigEntry->Value;
|
ConfigEntry = CONTAIN_RECORD(ConfigListEntry, XTBL_CONFIG_ENTRY, Flink);
|
||||||
}
|
|
||||||
|
|
||||||
/* Move to the next config entry */
|
/* Check if requested configuration found */
|
||||||
ConfigListEntry = ConfigListEntry->Flink;
|
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 */
|
/* Config entry not found, return NULL */
|
||||||
|
Loading…
Reference in New Issue
Block a user