Skip to content
Snippets Groups Projects
Commit 072a39a7 authored by Lars Möllendorf's avatar Lars Möllendorf
Browse files

Fix heap overflow in `iniparser_dumpsection_ini()`

...reported in #177

As suggested by the issue reporter this is fixed by returning from
`iniparser_dumpsection_ini()` in case the length of the passed section name
of dictionary to dump was bigger than the size of the internal buffer used
to copy this string to.

Changelog: changed
parent fe09afa9
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
......@@ -327,6 +327,7 @@ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f)
if (d==NULL || f==NULL) return;
if (! iniparser_find_entry(d, s)) return;
if (strlen(s) > sizeof(keym)) return;
seclen = (int)strlen(s);
fprintf(f, "\n[%s]\n", s);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment