mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-11 12:53:59 +00:00
* Find and Replace: bound the text a replacement builds 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. * address review: enforce the 32,767-character limit on replacements and borrow the replacement text