mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Check string length when creating strings to not exceed a maximum, so we avoid integer overflows when concatenating strings. The string limit must be small enough that we'll not integer overflow in one concatenation (A + B + 1 must not overflow while still exceeding the string limit). Set the limit to 64KB for now. If we need 2GB strings then we will have to use double or int64 variables when calculating string lengths.
14 KiB
14 KiB