fix a buffer overrun bug in steam_http where the buffer size wasn't set correctly

This commit is contained in:
a 2024-08-16 00:55:26 +03:00
parent 587e629df9
commit ed1eec0983

View File

@ -347,7 +347,8 @@ void Steam_HTTP::online_http_request(Steam_Http_Request *request, SteamAPICall_t
unsigned int file_size = file_size_(request->target_filepath);
if (file_size) {
long long read = Local_Storage::get_file_data(request->target_filepath, (char *)&request->response[0], file_size, 0);
request->response.resize(static_cast<size_t>(file_size));
long long read = Local_Storage::get_file_data(request->target_filepath, (char *)&request->response[0], file_size);
if (read < 0) read = 0;
request->response.resize(static_cast<size_t>(read));
}