mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
02f60421f9
Add strict validation for `StrToInts` function. Because this function should only be used with trusted internal strings, assertions are added to ensure that the string is not truncated. Some buffer sizes are adjusted accordingly, so truncation cannot happen. Add less strict validation for `IntsToStr` function. An additional argument specifying the size of the output buffer is added to assert that the size of the output buffer is sufficient. However, because this function is used to decode data sent by the server and read from maps and ghosts, invalid input data should never result in crashes or invalid UTF-8 strings. The function will now unpack an empty string and return `false`, if the string contains invalid UTF-8. The inline definition of the functions is not wanted, because it requires adding a `system.h` include in `gamecore.h`. Therefore the tools now have to depend on game-shared, which previously only worked because the functions were inline. Tests are added to ensure the function still behaves the same as before for valid inputs and correctly handles invalid inputs. |
||
---|---|---|
.. | ||
aio.cpp | ||
bezier.cpp | ||
blocklist_driver.cpp | ||
bytes_be.cpp | ||
color.cpp | ||
compression.cpp | ||
csv.cpp | ||
datafile.cpp | ||
fs.cpp | ||
git_revision.cpp | ||
hash.cpp | ||
huffman.cpp | ||
io.cpp | ||
jobs.cpp | ||
json.cpp | ||
jsonwriter.cpp | ||
linereader.cpp | ||
mapbugs.cpp | ||
math.cpp | ||
memory.cpp | ||
name_ban.cpp | ||
net.cpp | ||
netaddr.cpp | ||
os.cpp | ||
packer.cpp | ||
prng.cpp | ||
score.cpp | ||
secure_random.cpp | ||
serverbrowser.cpp | ||
serverinfo.cpp | ||
str.cpp | ||
strip_path_and_extension.cpp | ||
swap_endian.cpp | ||
teehistorian.cpp | ||
test.cpp | ||
test.h | ||
thread.cpp | ||
timestamp.cpp | ||
unix.cpp | ||
uuid.cpp |