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 GitHub
parent 06e31ece8f
commit c5dc0d8c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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