config: create a copy of the section name

The parsing context keeps a pointer to the current section name. This
is used when logging errors.

However, the pointer was into a buffer allocated by getline(). This
buffer are often re-used in the next call to getline(), or free:d.

Regardless, the section name pointer is invalid after the next call to
getline(), which meant all error messages were logging a correct
section name.
This commit is contained in:
Daniel Eklöf 2021-11-21 10:55:57 +01:00
parent 43798685d8
commit 9b232e07f9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 9 additions and 2 deletions

View file

@ -49,6 +49,7 @@
* Regression: `letter-spacing` resulting in a “not a valid option”
error (https://codeberg.org/dnkl/foot/issues/795).
* Regression: bad section name in configuration error messages.
### Security