2393 Commits

Author SHA1 Message Date
Kawe Mazidjatari
a7cab1d891 Fix potential security flaws caused by uncontrolled format strings
Make sure format strings are string literals to avoid an uncontrolled format string situation.
2023-04-08 19:10:59 +02:00
Kawe Mazidjatari
2c28391ca4 Make 'FL_EDICT_INVALID' unsigned
Should be unsigned as the type we test this on (edict_t) is of type unsigned short.
2023-04-08 19:02:14 +02:00
Kawe Mazidjatari
504a20945e Fix bug caused by never returning a value
Probably does return in compiled code, but this was never explicitly defined.
2023-04-08 19:01:35 +02:00
Kawe Mazidjatari
1d04f837f8 Fix many high level compiler warnings
* Put initializer values inside brackets.
* Put logical AND conditions within parentheses.
* Put assignments within conditional statements within parentheses.
* Mark unused variables as such to suppress compiler warnings.
* Fix vftable shadow warnings caused by ConVar::CreateInternal (does not implement, only interface. Renamed to yield desired behavior).
* Fix 'never' initialized class members for 'CCVarIteratorInternal'.
* Return values in interface vftables that cannot be pure virtual.
2023-04-08 19:00:28 +02:00
Kawe Mazidjatari
a83d5737e7 Fix non-portable include paths
Portable include paths are case sensitive.
2023-04-08 18:54:31 +02:00
Kawe Mazidjatari
4079956356 Fix non-portable include paths
Portable include paths are case sensitive.
2023-04-08 18:52:33 +02:00
Kawe Mazidjatari
a2bb707902 Fix unhandled enumerants in switch statement 2023-04-08 18:30:38 +02:00
Kawe Mazidjatari
f62092d6f2 Fix sign of array subscript
Must be unsigned to avoid indexing on negative numbers.
2023-04-08 18:28:39 +02:00
Kawe Mazidjatari
21ea4dff52 Return maps based on partial input
Return maps based on partial input from user in main 'map' completion callback function.
2023-04-08 18:19:14 +02:00
Kawe Mazidjatari
60b38e8904 Implement 'StringUnescape' properly 2023-04-08 18:05:05 +02:00
Kawe Mazidjatari
dc6bdc4a3a Fix incorrect ctor order 2023-04-08 17:46:08 +02:00
Kawe Mazidjatari
23b2d0174a Fix incorrect ctor order 2023-04-08 17:45:21 +02:00
rexx
7a4358800d Fix potential crash from server prints 2023-04-08 16:07:43 +01:00
Kawe Mazidjatari
f5a86f7087 Make global timestamp const
Should never change once initialized.
2023-04-08 16:11:25 +02:00
Kawe Mazidjatari
d49f252f4d Write minidump and slight code improvements
* Write minidumps to disk when the game crashes.
* Initialize global process timestamp as early as possible and separate from log dir.
2023-04-08 16:09:23 +02:00
Kawe Mazidjatari
b089c59062 Properly implement 'CCrashHandler::FormatFPU'
Fixes a bug causing decimal numbers to be displayed while negative numbers in register equals or exceeds one million.
2023-04-08 13:34:31 +02:00
Kawe Mazidjatari
4890593203 Add absolute array comparators
Check for highest/lowest value in array (absolute).
2023-04-08 13:32:34 +02:00
Kawe Mazidjatari
16910aa45c Use custom string formatter
Enforce consistency through code base by using the same format specifiers.
2023-04-08 10:50:32 +02:00
Kawe Mazidjatari
9f428f1567 Move tier0 lib headers to public
This commit does not change any logic or behavior of the code.
2023-04-06 23:50:48 +02:00
Kawe Mazidjatari
5e95b280c0 Fix level 3/4 compiler warnings
Fix level 3 and 4 compiler warnings in 'lzss.cpp'.
2023-04-06 21:01:42 +02:00
Kawe Mazidjatari
874faea430 Add hook to CLZSS::SafeUncompress
Added hook to use the SDK implementation of 'CLZSS::SafeUncompress' instead, since the one in the game executable does not check bounds on the iterator pointer. This fixes the problem of people crashing servers with malicious packets.
2023-04-06 00:28:58 +02:00
Kawe Mazidjatari
596e827352 Add platform defines for endianness 2023-04-05 23:01:46 +02:00
Kawe Mazidjatari
a5489f16b6 Fix small oversight
Should be '+1' as 'position' could be 0.
2023-04-05 22:58:26 +02:00
Kawe Mazidjatari
e76f5b98c8 CLZSS: Fix bug causing iterator to go out of bounds
Check if 'position' exceeds buffer size.
2023-04-05 22:31:37 +02:00
Kawe Mazidjatari
dbe1850ec1 Add LZSS implementation to SDK 2023-04-05 21:38:28 +02:00
Kawe Mazidjatari
69775ca234 CPackedStore: Improve symbol naming 2023-04-05 20:09:23 +02:00
Kawe Mazidjatari
dda78ed36e
Update persona name pattern
Add '-' character to allowed characters in persona name.
2023-04-05 15:32:00 +02:00
Kawe Mazidjatari
697d11cccb Improve VPKPair_t constructor
* Take string object by const reference.
* Emit warnings when locale or target specified by user isn't supported.
2023-04-04 00:41:53 +02:00
Kawe Mazidjatari
6da5206282 CPackedStore: Fix file handle bug
VPK directory file handle was never closed properly in 'VPKDir_t::Init()';
2023-04-03 22:48:29 +02:00
Kawe Mazidjatari
1f1a487af9 CPackedStore: Fix bug and improve code readability
Moved deduplication code to a separate function. Unnested packing and unpacking code a bit more.
2023-04-03 22:46:10 +02:00
Kawe Mazidjatari
081c548bdd Remove unnecessary member from 'VPKChunkDescriptor_t' 2023-04-03 21:16:15 +02:00
Kawe Mazidjatari
dc0fba9319 CPackedStore: Rename 'useDataSharing' to 'deDuplicate'
More descriptive in what it does (deduplication of existing copies).
2023-04-03 20:08:36 +02:00
Kawe Mazidjatari
b5bd4296e9 CPackedStore: Dynamically allocate source/destination buffers
This allows for multithreading the VPK build process.
2023-04-03 20:02:56 +02:00
Kawe Mazidjatari
475262fc24 Use C-style format specifiers in CPakFile
Enforce consistency within codebase.
2023-04-03 19:12:15 +02:00
Kawe Mazidjatari
b8d97d0d1c Cleanup 'Mod_GetAllInstalledMaps'
Light cleanup
2023-04-03 18:38:36 +02:00
Kawe Mazidjatari
32d04645ca Put launcher playlists parsing code in try catch block
Avoid crash due to exceptions.
2023-04-03 18:38:20 +02:00
Kawe Mazidjatari
7de0ed24b1 Update CClient class
Members 'm_szServerName' and 'm_szClientName' are both 256 bytes in size.
2023-04-03 18:37:35 +02:00
Kawe Mazidjatari
3463d0070f Improve text formatting in 'Host_Status_PrintClient'
Better 'status' command output.
2023-04-03 14:56:03 +02:00
Kawe Mazidjatari
fe0cce731b Explicitly disable certain warnings in code
This code is good as-is, they cannot be adjusted to suppress the warnings while still guaranteeing its functionality.
2023-04-03 14:55:16 +02:00
Kawe Mazidjatari
d620a7efe8 Fix compiler warnings in cppnet
Constant expressions.
2023-04-03 14:53:17 +02:00
Kawe Mazidjatari
c729b6faa8 Fix symbol shadowing warnings in VDF parser 2023-04-03 14:52:22 +02:00
Kawe Mazidjatari
40f065bc1d Fix warnings in cppkore 2023-04-03 14:51:45 +02:00
Kawe Mazidjatari
a857403b9e Fix type conversion warning in netconsole tool 2023-04-03 14:51:18 +02:00
Kawe Mazidjatari
a79ed2f52f Fix bug in navmesh tool caused by transforming string
Value passed into 'std::tolower' must be unsigned.
2023-04-03 14:50:30 +02:00
Kawe Mazidjatari
5551909ac7 Explicitly cast to types to suppress warnings in navmesh tool 2023-04-03 14:49:18 +02:00
Kawe Mazidjatari
e9cbe34a95 Remove dead code from navmesh tool 2023-04-03 14:48:38 +02:00
Kawe Mazidjatari
9a1343b231 Fix symbol shadowing warnings in navmesh tool 2023-04-03 14:47:41 +02:00
Kawe Mazidjatari
8809f17504 Compile NetMsg out entirely for dedicated 2023-04-03 14:34:46 +02:00
Kawe Mazidjatari
87831050e9 Fix SDK launcher compiler warning
Unused param.
2023-04-03 13:12:36 +02:00
Kawe Mazidjatari
fee5f7608e Fix SDK launcher bug
Add missing argument for string format specifier. Fixed additional compiler warnings by casting types/commenting unused.
2023-04-03 13:12:22 +02:00