Skip to content

fix: guard silent chat trim to avoid OOB write#1329

Open
mytsvy wants to merge 1 commit into
roflmuffin:mainfrom
mytsvy:mytsvy/fix-chat-oob-write
Open

fix: guard silent chat trim to avoid OOB write#1329
mytsvy wants to merge 1 commit into
roflmuffin:mainfrom
mytsvy:mytsvy/fix-chat-oob-write

Conversation

@mytsvy
Copy link
Copy Markdown

@mytsvy mytsvy commented Jun 1, 2026

Problem

When a silent chat trigger is sent alone, pszMessage becomes empty (V_strlen == 0), leading to a potential out-of-bounds (OOB) write via pszMessage[len - 1] = 0.

Solution

Added a length check inside the bSilent block to ensure the trailing character is only removed when len > 0.

Impact & Testing

  • Risk: Low risk; safely handles the empty message edge case.
  • Testing: Manually tested with single-character silent triggers (! and /). Works perfectly without any issues, and normal commands continue to function as expected.

@mytsvy mytsvy requested a review from roflmuffin as a code owner June 1, 2026 17:07
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