Fix segfault during config validation () ()

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 GitHub
parent 06e31ece8f
commit c5dc0d8c93

@ -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) {