Skip to content

Fix network buffer overflow and clean up strncpy() - #741

Merged
timangus merged 3 commits into
ioquake:mainfrom
zturtleman:clean-up-strncpy
Jul 24, 2025
Merged

Fix network buffer overflow and clean up strncpy()#741
timangus merged 3 commits into
ioquake:mainfrom
zturtleman:clean-up-strncpy

Conversation

@zturtleman

Copy link
Copy Markdown

Fixed a possible buffer overflow reading CS_SHADERSTATE in CGame.

The code was a inconsistent mix of strncpy() with manual NUL and Q_strncpyz(). Use Q_strncpyz() if possible.

These commits were cherry-picked from #659 PR draft.

It can't overflow because buff and text have the same max length (1024
and MAX_TOKENLENGTH).
@timangus
timangus merged commit 1132abe into ioquake:main Jul 24, 2025
4 checks 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.

2 participants