You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method CBasePlayer::PackDeadPlayerItems can cause a buffer overflow if a custom gamerules object is used that returns the rule GR_PLR_DROP_GUN_ALL from CGameRules::DeadPlayerWeapons.
This doesn't affect vanilla Half-Life or Opposing Force, but to prevent mods from introducing such a vulnerability the SDK should definitely be updated.
The text was updated successfully, but these errors were encountered:
The method
CBasePlayer::PackDeadPlayerItems
can cause a buffer overflow if a custom gamerules object is used that returns the ruleGR_PLR_DROP_GUN_ALL
fromCGameRules::DeadPlayerWeapons
.The line in question is this one;
halflife/dlls/player.cpp
Line 687 in c7240b9
If the player has more than 20 weapons this will overwrite whatever is on the stack after that array.
The simplest fix is to use the constant
MAX_WEAPONS
instead of20
:halflife/dlls/cdll_dll.h
Line 23 in c7240b9
This doesn't affect vanilla Half-Life or Opposing Force, but to prevent mods from introducing such a vulnerability the SDK should definitely be updated.
The text was updated successfully, but these errors were encountered: