When a config file defines a [keys] table but omits a category, LoadConfig fills the missing category with:
conf.Keys[keyCategory] = keys
where keys is the value from the package-global DefaultKeys map. This assigns the shared map by reference rather than copying it.
As a result, the omitted category in the returned config and the global DefaultKeys point at the same underlying map. Mutating the loaded config (or anything later editing that category) corrupts DefaultKeys, so subsequent LoadConfig calls observe altered defaults.
Low severity (wuzz typically loads config once), but it is a latent global-state corruption bug. The categories that are present are already deep-copied; the omitted-category branch should copy too.
When a config file defines a
[keys]table but omits a category,LoadConfigfills the missing category with:where
keysis the value from the package-globalDefaultKeysmap. This assigns the shared map by reference rather than copying it.As a result, the omitted category in the returned config and the global
DefaultKeyspoint at the same underlying map. Mutating the loaded config (or anything later editing that category) corruptsDefaultKeys, so subsequentLoadConfigcalls observe altered defaults.Low severity (wuzz typically loads config once), but it is a latent global-state corruption bug. The categories that are present are already deep-copied; the omitted-category branch should copy too.