Skip to content

LoadConfig aliases the shared DefaultKeys map for omitted key categories #165

Description

@Noethix55555

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions