mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-03 00:41:56 -06:00
Each occurrence copied the whole replacement string, so a cell full of short matches and a long replacement expanded tens of kilobytes of input into about a gigabyte, in both the case-sensitive and the case-insensitive paths. Replacement now builds the new text only while it stays within Excel's 32,767 characters per cell (counted as UTF-8 bytes, 4 each at most) and within 256 MiB for the whole command, checking before each copy. Past either limit the command fails and changes nothing.