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

fix: crash when process name filter longer than 7 #75

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

happyharryh
Copy link

There are two issues in the codes related to the process name filter that result in a crash when the provided process name exceeds 7 characters in length:

  1. The use of sizeof(Token) does not return the length of the string but instead gives the size of a pointer to TCHAR, which is always 8 bytes on the amd64 platform.

  2. The strcpy_s function crashes when the length of the src (the third argument) exceeds the destsz (the second argument), as observed in my tests.

This PR resolves the crash by replacing strcpy_s with _tcsncpy_s.

@4x3-64

@gsass1 gsass1 merged commit 326ccd8 into gsass1:master Dec 23, 2024
@gsass1
Copy link
Owner

gsass1 commented Dec 23, 2024

Ty

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.

3 participants