Fix: [Script] Ensure the saved script strings are properly validated and terminated when being read from the save game #9336
Motivation / Problem
Just set the string data length to 255 and fill it will all non-zeros. When buf is also non-zeros, this will read beyond the bounds when making the string. Similarly the maximum value of _script_sl_byte can only be 255 though 256 bytes are allocated for the buffer.
Allocate just enough memory for a buffer of _script_sl_byte long.
Potentially a game script that put some non-Utf8 characters in their strings would get different information when loading compared to what they saved. However, a string should be a valid string. If you want something else stored, use an array of integers.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.