Skip to content

Conversation

@DankRank
Copy link

@DankRank DankRank commented Feb 2, 2021

It's actually impossible for the ANSI version of LoadString to be implemented as documented, because the string resources are stored in Unicode only.

If you try to call LoadStringA with cchBufferMax=0, it will attempt to null-terminate the 0-length buffer (i.e. it will do lpBuffer[-1] = 0, corrupting nearby memory), and return -1.

It's actually impossible for the ANSI version of LoadString to be
implemented as documented, because the string resources are stored
in Unicode only.

If you try to call LoadStringA with cchBufferMax=0, it will attempt to
null-terminate the 0-length buffer (i.e. it will do `lpBuffer[-1] = 0`,
corrupting nearby memory), and return -1.
@ghost
Copy link

ghost commented Feb 2, 2021

CLA assistant check
All CLA requirements met.

@PRMerger14
Copy link

@DankRank : Thanks for your contribution! The author(s) have been notified to review your proposed change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants