Skip to content
Snippets Groups Projects
Commit a938ab1e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix potential null pointer derefs in iniGetParsedSection* functions

This would crash/segfault when the .ini files didn't exist
parent 836778af
No related branches found
No related tags found
No related merge requests found
......@@ -1526,7 +1526,7 @@ str_list_t iniGetParsedSectionList(named_str_list_t** list, const char* prefix)
str_list_t result = strListInit();
named_str_list_t* section;
for(i = 0; list[i] != NULL; ++i) {
for(i = 0; list != NULL && list[i] != NULL; ++i) {
section = list[i];
if(section->name == NULL)
continue;
......@@ -1547,6 +1547,9 @@ str_list_t iniGetParsedSection(named_str_list_t** list, const char* name, BOOL c
if(name == NULL) // Root section not supported
return NULL;
if(list == NULL)
return NULL;
for(i = 0; list[i] != NULL; ++i) {
section = list[i];
if(section->name == NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment