Skip to content

Bug and vulenrability fix#5

Merged
PiscesTrio merged 6 commits into
mainfrom
dev
May 11, 2026
Merged

Bug and vulenrability fix#5
PiscesTrio merged 6 commits into
mainfrom
dev

Conversation

@PiscesTrio
Copy link
Copy Markdown
Contributor

No description provided.

PiscesTrio added 6 commits May 7, 2026 11:15
- net_common.h: add ammo/ammoReserve to NetPlayerState with pad[2] for 4-byte alignment; size_asserts updated to 48 / 52
- net_common.h: extract shared WeaponConfig namespace (MAG_SIZE, MAX_RESERVE, RELOAD_DURATION)
- PlayerData: ammo decremented on fire, refilled on reload completion (gated by ammo<MAG && reserve>0); reset to MAG_SIZE/MAX_RESERVE on connect and respawn
- Reload duration unified to WeaponConfig::RELOAD_DURATION (was hardcoded 10.0)
Add <cmath> and validate incoming InputCmd float fields with std::isfinite to drop packets containing NaN/Inf (prevents physics/state corruption and potential 1-player DoS). Also check enet_packet_create return value in SendSnapshotToPlayer and SendSnapshot to avoid dereferencing NULL packets and crashing the server.
@PiscesTrio PiscesTrio merged commit 2f0ba02 into main May 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant