Skip to content

PIX event decoder attempts to modify constant memory #4

Description

Describe the bug
The PIX event decoder attempts to modify constant memory.

To Reproduce
See

*const_cast<char*>(reinterpret_cast<char const*>(nullTerminator)) = '\0';

Expected behavior
When this code needs to make a not-null-terminated string into a null-terminated string, it needs to copy the input into a buffer that is explicitly allocated as modifiable, and is guaranteed to be large enough to include the null terminator.

Actual behavior
If a static const pointer to a not-null-terminated string is passed into the decoder API, the decoder can crash.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions