diff options
author | rubidium42 <rubidium42@users.noreply.github.com> | 2021-04-30 00:16:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 23:16:41 +0100 |
commit | f00564eeb20a09647f6f52b4ca5b39cb1e6a59aa (patch) | |
tree | 397ceaa6366401b5f10cb90acf7c254a54014dc1 /src/newgrf_class.h | |
parent | f018471b36fe1ffaedf98430b4156ad369e26c66 (diff) | |
download | openttd-f00564eeb20a09647f6f52b4ca5b39cb1e6a59aa.tar.xz |
Fix: String validation could leave invalid Utf8 encoded strings (#9096)
In case a character was encoded in multiple bytes, but required fewer bytes to be encoded, the first byte would be copied to the output leaving an invalid Utf8 encoded string. Later uses of the validated string would use the same decode logic, which would yield a question mark and just read a single byte, so nothing dangerous happened.
Furthermore, because the next byte would not be a first byte of an encoded Utf8 character, the last few valid characters could be removed by the validation as well.
Diffstat (limited to 'src/newgrf_class.h')
0 files changed, 0 insertions, 0 deletions