Skip to content

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

@malikm

Description

@malikm

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.

Metadata

Metadata

Labels

PresentDataRelates to the collection/analysis library (PresentData/)bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions