mirror of
https://github.com/storytold/cadcraft.git
synced 2026-11-10 04:19:59 -06:00
`MAX_PROFILE_BYTES` (64 KiB) was smaller than a valid profile: ALIASEDIT holds up to 10,000 aliases, and a serialized full set can be megabytes. On restart `load_profile` then dropped the whole profile, aliases and unrelated settings included. The engine now states the largest alias section `alias_profile` can produce (`MAX_ALIAS_PROFILE_BYTES`, from the alias count, name and command-id limits, and the alias file path); the loader's cap is that plus fixed room for the sysvars and interface preferences. Hostile input over the cap is still rejected without changing anything. Tests: a full 10,000-alias profile (620 KB, far past the old 64 KiB) restores completely, one byte over the new cap is refused, every catalog command id fits the bound, and the hostile-profile tests now pad past the real cap.