SteamWrap
SteamWrap copied to clipboard
SteamWrap_FileRead buffer overflow
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);
I believe using alloc_string_len might fix this:
https://github.com/larsiusprime/SteamWrap/issues/10
I'm working on a patch.