Skip to content

Add small overhead for event size constraints - #5367

Merged
Lpsd merged 2 commits into
multitheftauto:masterfrom
Lpsd:netstuff
Sep 11, 2026
Merged

Add small overhead for event size constraints#5367
Lpsd merged 2 commits into
multitheftauto:masterfrom
Lpsd:netstuff

Conversation

@Lpsd

@Lpsd Lpsd commented Sep 11, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 11, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A moderate size-limit validation issue remains in CLuaEventPacket.cpp.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds protocol headroom to Lua event size checks and hardens latent-transfer buffer validation.

Changes:

  • Adds 64 KiB event envelope headroom.
  • Enforces latent packet limits with safer bounds checks.
  • Applies size validation across event handling paths.
File summaries
File Summary
Shared/mods/deathmatch/logic/CLatentReceiver.cpp Updates latent packet limits and buffer validation.
Server/mods/deathmatch/logic/packets/CLuaEventPacket.h Defines shared event headroom.
Server/mods/deathmatch/logic/packets/CLuaEventPacket.cpp Applies event size validation; post-consumption headroom handling requires correction.
Server/mods/deathmatch/logic/CGame.cpp Accounts for envelope overhead in incoming event checks.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Server/mods/deathmatch/logic/packets/CLuaEventPacket.cpp
Copilot AI review requested due to automatic review settings September 11, 2026 20:19
@Lpsd
Lpsd merged commit 2189a0d into multitheftauto:master Sep 11, 2026
9 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Enforce the documented argument limit without adding envelope headroom to the payload-only check.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

if (usNameLength < (MAX_EVENT_NAME_LENGTH - 1) && BitStream.ReadStringCharacters(m_strName, usNameLength) && BitStream.Read(m_ElementID))
{
if (BitStream.GetNumberOfUnreadBits() > MAX_LUA_LATENT_EVENT_ARGUMENTS_SIZE * 8)
if (BitStream.GetNumberOfUnreadBits() > (MAX_LUA_LATENT_EVENT_ARGUMENTS_SIZE + LUA_EVENT_ENVELOPE_HEADROOM) * 8)
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.

2 participants