Skip to content

Fix CodeQL overflowing snprintf in SetPublisher JSON logging#1

Open
peter-matkovski wants to merge 1 commit into
mainfrom
fix/codeql-overflowing-snprintf-sfu-client
Open

Fix CodeQL overflowing snprintf in SetPublisher JSON logging#1
peter-matkovski wants to merge 1 commit into
mainfrom
fix/codeql-overflowing-snprintf-sfu-client

Conversation

@peter-matkovski

Copy link
Copy Markdown

Summary

  • Fixes code scanning alert #1 and #2 (cpp/overflowing-snprintf) in sfu_client.c
  • Adds sfu_buf_advance() to validate snprintf return values before advancing the write offset
  • Skips debug JSON logging when the buffer would overflow instead of using an unchecked truncated length

Test plan

Made with Cursor

Check snprintf return values before advancing the write offset so
json_cap - pos cannot underflow when output is truncated.

Co-authored-by: Cursor <cursoragent@cursor.com>
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