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

SteamWrap_FileRead buffer overflow #15

Open
maaniv opened this issue Jun 5, 2017 · 1 comment
Open

SteamWrap_FileRead buffer overflow #15

maaniv opened this issue Jun 5, 2017 · 1 comment

Comments

@maaniv
Copy link

maaniv commented Jun 5, 2017

Function SteamWrap_FileRead code do not put zero to end of string
char *bytesData = (char *)malloc(length);
int32 result = SteamRemoteStorage()->FileRead(fName, bytesData, length);

value returnValue = alloc_string(bytesData);

Must be
char *bytesData = (char *)malloc(length + 1);
int32 result = SteamRemoteStorage()->FileRead(fName, bytesData, length);
*(bytesData + length) = 0;

value returnValue = alloc_string(bytesData);
@larsiusprime
Copy link
Owner

larsiusprime commented Aug 17, 2017

I believe using alloc_string_len might fix this:
#10

I'm working on a patch.

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

No branches or pull requests

2 participants