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

Crash when launching an application with non-ANSI characters in filename #191

Closed
malikm opened this issue Dec 11, 2023 · 1 comment
Closed
Assignees
Labels
bug PresentData Relates to the collection/analysis library (PresentData/)

Comments

@malikm
Copy link

malikm commented Dec 11, 2023

When launching a process with non-ANSI characters in filename (e.g. try to copy notepad.exe and rename it to include non-ANSI characters), PresentMon crashes in HandleProcessEvent here:

wcstombs_s(&size, &event.ImageFileName[0], size + 1, ImageName.c_str() + start, size);

Problem is that if wcstombs_s fails to convert the process name to ANSI, the resulting string size will be 0.
Best solution would be to change ImageFileName to wstring rather than a plain char string. This will also allow proper filtering of process names with non-ANSI chars.

@JeffersonMontgomery-Intel JeffersonMontgomery-Intel added bug PresentData Relates to the collection/analysis library (PresentData/) labels Dec 11, 2023
@JeffersonMontgomery-Intel
Copy link
Collaborator

Thanks for debugging and reporting, we'll fix this soon.

malikm pushed a commit to malikm/PresentMon that referenced this issue Dec 12, 2023
malikm pushed a commit to malikm/PresentMon that referenced this issue Dec 12, 2023
Also to fix GameTechDev#191

Signed-off-by: Martin Malik <mm@hwinfo.com>
JeffersonMontgomery-Intel added a commit that referenced this issue Dec 28, 2023
See PR #192 and issue #191.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PresentData Relates to the collection/analysis library (PresentData/)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants