SteamWrap icon indicating copy to clipboard operation
SteamWrap copied to clipboard

SteamWrap_FileRead buffer overflow

Open maaniv opened this issue 8 years ago • 1 comments

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);

maaniv avatar Jun 05 '17 11:06 maaniv

I believe using alloc_string_len might fix this: https://github.com/larsiusprime/SteamWrap/issues/10

I'm working on a patch.

larsiusprime avatar Aug 17 '17 14:08 larsiusprime