mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 11:38:19 +00:00
14e70506e1
3535: Fix a possible race in load code r=def- a=heinrich5991 Previously, a save could possibly be loaded twice given enough latency discrepancy between servers. The server only verified that it deleted *some* save with the given password, not *the* save it is trying to load. This is fixed by also checking the SaveID column that is random and globally unique (except for the old NULLs). Since users can't create new saves with NULL SaveID, these pose no problem. Also change the default UUID for saves without save ID to something nonzero, so we can't accidentally hit it due to a bug. ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [x] Written a unit test if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: heinrich5991 <heinrich5991@gmail.com> |
||
---|---|---|
.. | ||
aio.cpp | ||
bezier.cpp | ||
blocklist_driver.cpp | ||
color.cpp | ||
csv.cpp | ||
datafile.cpp | ||
fs.cpp | ||
git_revision.cpp | ||
hash.cpp | ||
jobs.cpp | ||
json.cpp | ||
mapbugs.cpp | ||
name_ban.cpp | ||
packer.cpp | ||
prng.cpp | ||
str.cpp | ||
strip_path_and_extension.cpp | ||
teehistorian.cpp | ||
test.cpp | ||
test.h | ||
thread.cpp | ||
unix.cpp | ||
uuid.cpp |