Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PINE: Fix stack buffer overflow for long XDG_RUNTIME_DIR paths #12026

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

chaoticgd
Copy link
Contributor

@chaoticgd chaoticgd commented Nov 21, 2024

Description of Changes

A strcpy call has been swapped out with a strncpy StringUtil::Strlcpy call in PINEServer::Initialize.

Rationale behind Changes

For example, on Linux you could previously make it crash with the following command if PINE was enabled:

XDG_RUNTIME_DIR=/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/really/long/path ./build/bin/pcsx2-qt 

Suggested Testing Steps

Try the command above, make sure it doesn't crash.

@chaoticgd chaoticgd marked this pull request as ready for review November 21, 2024 11:36
@chaoticgd chaoticgd force-pushed the pine_buffer_overflow branch from 2b3c4ae to 3f86f53 Compare November 21, 2024 13:02
@F0bes F0bes merged commit f69d583 into PCSX2:master Nov 22, 2024
12 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