ddnet/src/engine/shared
bors[bot] 8d61322ca3
Merge #4788
4788: Add size checks to CVariableInt::Pack and ::Unpack, refactoring r=def- a=Robyt3

- Refactor `CVariableInt::Pack` some more according to upstream:
   - avoid right shift of negative number
   - rewrite loop smarter
- Add size parameters to `CVariableInt::Pack` and `CVariableInt::Unpack`. Adjust tests and add tests with too small buffer sizes.

## 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: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-03-05 22:15:56 +00:00
..
compression.cpp Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
compression.h Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
config.cpp Sync the config file replacement to disk before renaming 2022-02-01 02:33:20 +01:00
config.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
config_variables.h Lower the sound volume even further after #4568 2022-02-10 18:05:13 +01:00
console.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
console.h Add some checksum functions to the client 2022-01-31 21:31:26 +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 Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
datafile.h Fix duplicate uuid index in maps edited by tools 2021-05-03 12:02:18 +02:00
demo.cpp Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
demo.h Merge #4340 #4350 2021-11-15 19:33:45 +00:00
econ.cpp Remove unused Flags argument in network code 2022-03-04 19:33:06 +01:00
econ.h uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
engine.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
fifo.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
fifo.h Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
filecollection.cpp Add more readability checks 2022-01-22 17:45:25 +01:00
filecollection.h Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
global_uuid_manager.cpp Move teehistorian UUIDs into engine 2018-01-11 16:01:13 +01:00
huffman.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
huffman.h Run clang-format 2020-09-26 21:50:15 +02:00
image_manipulation.cpp Update missing file from dilate 2021-02-13 14:04:42 +01:00
image_manipulation.h Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
jobs.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
jobs.h Make it possible to run jobs in the current thread 2021-05-13 03:15:18 +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 Fix some variable name's style 2020-11-08 17:15:48 +01:00
linereader.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
linereader.h Don't access out of bounds in linereader (fixes #4308) 2021-11-07 01:10:34 +01:00
map.cpp Fix clang-format 2022-02-15 00:32:04 +01:00
map.h Add menu background map 2020-09-23 23:38:28 +02:00
masterserver.cpp Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
memheap.cpp Fix alignment for CVoteOptionServer 2021-05-27 19:35:20 +02:00
memheap.h Fix alignment for CVoteOptionServer 2021-05-27 19:35:20 +02:00
netban.cpp Increase max ban duration from 1 month to 1 year 2021-03-08 18:15:00 +01:00
netban.h Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
network.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
network.h Hide the recvmmsg as an implementation detail 2022-03-04 19:33:06 +01:00
network_client.cpp Unify buffer handling in UDP sockets across operating systems 2022-03-05 14:11:03 +01:00
network_conn.cpp Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
network_console.cpp Remove unused Flags argument in network code 2022-03-04 19:33:06 +01:00
network_console_conn.cpp Move NETSOCKET behind a pointer so it can grow 2022-03-04 19:33:06 +01:00
network_server.cpp Unify buffer handling in UDP sockets across operating systems 2022-03-05 14:11:03 +01:00
packer.cpp Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
packer.h Run clang-format 2020-09-26 21:50:15 +02:00
protocol.h Support 128 players in serverbrowser 2022-01-02 13:41:59 +01:00
protocol_ex.cpp Run clang-format 2020-09-26 21:50:15 +02:00
protocol_ex.h Only use configured prediction margin on servers with predictable/synced weapon input 2022-01-11 01:30:05 +01:00
protocol_ex_msgs.h Add some checksum functions to the client 2022-01-31 21:31:26 +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
serverinfo.cpp Support 128 players in serverbrowser 2022-01-02 13:41:59 +01:00
serverinfo.h Support 128 players in serverbrowser 2022-01-02 13:41:59 +01:00
snapshot.cpp Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
snapshot.h Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
storage.cpp Add IStorage::FormatTmpPath static method 2021-12-20 16:12:15 +01: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_ready event in teehistorian 2022-02-07 23:31:46 +01:00
uuid_manager.cpp Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
uuid_manager.h Allow ParseUuid to report errors and add tests 2021-01-23 01:21:20 +01:00
video.cpp uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
video.h uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
websockets.cpp Use cpp 2021-06-24 17:19:17 +02:00
websockets.h Make sure headers compile standalone 2020-09-26 21:50:27 +02:00