Fix segfault during config validation (#5167) (#5173)

Configs with bar blocks will segfault during validation since they
copy the i3 font which is not set during validation.
This commit is contained in:
Matias Goldfeld 2022-10-10 12:52:55 -04:00 committed by Michael Stapelberg
parent 9d6a8735eb
commit d62183a2b8

View File

@ -275,11 +275,13 @@ bool load_configuration(const char *override_configpath, config_load_t load_type
/* Make bar config blocks without a configured font use the i3-wide font. */
Barconfig *current;
TAILQ_FOREACH (current, &barconfigs, configs) {
if (current->font != NULL) {
continue;
if (load_type != C_VALIDATE) {
TAILQ_FOREACH (current, &barconfigs, configs) {
if (current->font != NULL) {
continue;
}
current->font = sstrdup(config.font.pattern);
}
current->font = sstrdup(config.font.pattern);
}
if (load_type == C_RELOAD) {