diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-12-10 01:04:03 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-12-10 01:04:03 -0500 |
commit | c9a9073755537aec9024635147a74a1452b520cf (patch) | |
tree | e7c81bca02aed5e687c51ea5e025af51b781ad19 /src | |
parent | 2d0c4492b676a6ae889a19530a6cd99ac27b267e (diff) | |
download | stasis-c9a9073755537aec9024635147a74a1452b520cf.tar.gz |
Fix segfault when section is not present
Diffstat (limited to 'src')
-rw-r--r-- | src/ini.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -56,6 +56,10 @@ struct INIData *ini_getall(struct INIFILE *ini, char *section_name) { static size_t i = 0; section = ini_section_search(&ini, section_name); + if (i == section->data_count) { + i = 0; + return NULL; + } if (section->data_count) { result = section->data[i]; i++; |