ddnet/src/engine/shared
bors[bot] 4a4d6c5483
Merge #6284
6284: Ensure integer wrapping instead of preventing overflow/underflow r=heinrich5991 a=Robyt3

As the integer overflow/underflow in `UndiffItem` can happen during normal gameplay, we should in this case neither ignore the snapshot delta nor show an error message.

Instead of depending on the particular compiler doing integer wrapping, when integer overflows or underflows occur, we make it part of the design, by casting to `unsigned`, which ensures that integer wrapping is being used.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] 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: Robert Müller <robytemueller@gmail.com>
2023-01-18 22:46:52 +00:00
..
assertion_logger.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
assertion_logger.h Unify logging infrastructure between IConsole and dbg_msg 2022-04-29 15:21:26 +02:00
build.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
Cargo.toml Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
compression.cpp Consistently use static const instead of const static 2022-11-29 23:32:32 +01:00
compression.h Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
config.cpp Fix more unsafe define 2022-06-29 23:52:03 +02:00
config.h Minimal changes to default to Vulkan 2022-12-13 19:37:03 +01:00
config.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
config_variables.h Minimal changes to default to Vulkan 2022-12-13 19:37:03 +01:00
console.cpp Fix stored commands using original callback instead of the chain 2022-11-29 23:06:50 +01:00
console.h Fix stored commands using original callback instead of the chain 2022-11-29 23:06:50 +01:00
csv.cpp Add a simple CSV writer for Python's "excel" csv dialect 2020-06-23 09:11:59 +02:00
csv.h Fix some variable name's style 2020-11-08 17:15:48 +01:00
datafile.cpp src/engine/shared/datafile.cpp: Re-add #include <base/math.h> for big endian 2023-01-07 04:38:06 +02:00
datafile.h Minor tweaks to keep ODR across translation units 2022-07-02 14:25:16 +02:00
demo.cpp Fix undefined demo timeline markers when recording is not stopped 2023-01-03 15:38:54 +01:00
demo.h Prevent temporary demo file from being deleted multiple times 2022-12-30 14:20:42 +01:00
econ.cpp Fix some uninitialized variables, found with valgrind 2022-05-22 12:18:49 +02:00
econ.h Organize engine-shared includes 2022-06-17 17:39:24 +02:00
engine.cpp Print the operating system version on client/server launch 2022-10-03 13:19:31 +02:00
fifo.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
fifo.h Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
filecollection.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
filecollection.h Organize engine-shared includes 2022-06-17 17:39:24 +02:00
global_uuid_manager.cpp Move teehistorian UUIDs into engine 2018-01-11 16:01:13 +01:00
http.cpp Just quiet curl warnings for now 2022-12-25 19:34:19 +01:00
http.h Stop server if started with old curl and incompatible sv_register 2022-09-22 00:09:02 +02:00
huffman.cpp Remove redundant variable assignments 2022-11-29 23:32:26 +01:00
huffman.h Mark CHuffman::Compress and ::Decompress as const 2022-04-02 13:35:24 +02:00
jobs.cpp Add CLockScope 2022-06-03 12:21:23 +02:00
jobs.h Organize engine-shared includes 2022-06-17 17:39:24 +02:00
json.cpp Run clang-format 2020-09-26 21:50:15 +02:00
json.h Run clang-format 2020-09-26 21:50:15 +02:00
kernel.cpp Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
lib.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
linereader.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
linereader.h Fix announcement feature, don't depend on buffer staying consistent 2023-01-13 16:22:22 +01:00
localization.h Add Localizable hint 2022-12-13 17:53:32 +01:00
map.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
map.h Mark virtual function as override using a script: 2022-05-17 23:47:32 +02:00
masterserver.cpp Add HTTP masterserver registering and HTTP masterserver 2022-05-20 08:58:32 +02:00
masterserver.h Add HTTP masterserver registering and HTTP masterserver 2022-05-20 08:58:32 +02:00
memheap.cpp Organize base includes 2022-06-17 17:39:25 +02:00
memheap.h Add CHeap::StoreString method 2022-05-06 23:21:26 +02:00
netban.cpp Reduce duplicate code by extracting CNetBan::CBanPool::InsertUsed 2022-12-06 20:18:08 +01:00
netban.h Reduce duplicate code by extracting CNetBan::CBanPool::InsertUsed 2022-12-06 20:18:08 +01:00
network.cpp Remove check for pResponseToken, which isn't used on this code path 2022-12-06 20:37:59 +01:00
network.h Mark parameters as const when possible 2022-11-29 23:32:31 +01:00
network_client.cpp Allow multiple connect addresses 2022-07-10 16:57:10 +02:00
network_conn.cpp Mark parameters as const when possible 2022-11-29 23:32:31 +01:00
network_console.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
network_console_conn.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
network_server.cpp Fix sv_vanilla_antispoof for vanilla 0.6.5 clients 2023-01-18 20:21:12 +01:00
network_stun.cpp Only compare with old STUN server address if we have any 2022-07-10 16:53:15 +02:00
packer.cpp Add default values to extended Net Objects 2022-06-27 01:11:19 +02:00
packer.h Add default values to extended Net Objects 2022-06-27 01:11:19 +02:00
protocol.h Remove unnecessary include in protocol, move definitions to cpp file 2023-01-03 14:10:58 +01:00
protocol_ex.cpp Organize engine-shared includes 2022-06-17 17:39:24 +02:00
protocol_ex.h Organize engine-shared includes 2022-06-17 17:39:24 +02:00
protocol_ex_msgs.h Fix ddnet.org change in UUIDs 2023-01-12 15:38:17 +01:00
ringbuffer.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
ringbuffer.h Fix some variable name's style 2020-11-08 17:15:48 +01:00
rust_version.rs Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
serverinfo.cpp Add skin to serverbrowser player list 2023-01-07 09:20:25 +01:00
serverinfo.h Add skin to serverbrowser player list 2023-01-07 09:20:25 +01:00
snapshot.cpp Ensure integer wrapping instead of preventing overflow/underflow 2023-01-16 18:12:28 +01:00
snapshot.h Ensure integer wrapping instead of preventing overflow/underflow 2023-01-16 18:12:28 +01:00
storage.cpp Extract method IStorage::GetBinaryPathAbsolute 2023-01-02 15:29:43 +01:00
stun.cpp Use STUN to determine UDP connectivity and show diagnostics 2022-05-18 09:21:31 +02:00
stun.h Add bare-bones STUN protocol support 2022-05-18 09:20:54 +02:00
teehistorian_ex.cpp Run clang-format 2020-09-26 21:50:15 +02:00
teehistorian_ex.h Run clang-format 2020-09-26 21:50:15 +02:00
teehistorian_ex_chunks.h Record player switch in teehistorian 2022-05-21 21:37:17 +02:00
uuid_manager.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
uuid_manager.h Use std::vector<CName> instead of array, adjust variable name 2022-05-27 16:31:18 +02:00
video.cpp Organize engine-shared includes 2022-05-29 20:02:22 +02:00
video.h Use existing typedef instead of duplicating arguments 2022-06-17 17:39:26 +02:00
websockets.cpp Fix memset compilation 2022-08-25 14:07:49 +02:00
websockets.h Make sure headers compile standalone 2020-09-26 21:50:27 +02:00