lsteamclient: Fix g_tmppath buffer length.

CW-Bug-Id: #23197
This commit is contained in:
Paul Gofman 2024-01-04 14:59:44 -06:00 committed by Arkadiusz Hiler
parent ff94f04eca
commit 051cb009df
4 changed files with 20 additions and 18 deletions

View file

@ -561,7 +561,7 @@ class Struct:
if field.name not in path_conv_fields:
out(f' ret.{field.name} = this->{field.name};\n')
else:
out(f' steamclient_unix_path_to_dos_path(1, this->{field.name}, g_tmppath, sizeof(g_tmppath), 1);\n')
out(f' steamclient_unix_path_to_dos_path(1, this->{field.name}, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);\n')
out(f' ret.{field.name} = g_tmppath;\n')
out(u' return ret;\n')
out(u'}\n')

View file

@ -45,7 +45,7 @@ DEFINE_VTBL_WRAPPER(56);
#endif
static char temp_path_buffer[PATH_MAX];
static char temp_path_buffer[TEMP_PATH_BUFFER_LENGTH];
static CRITICAL_SECTION steamclient_cs = { NULL, -1, 0, 0, 0, 0 };
static HANDLE steam_overlay_event;

View file

@ -12,6 +12,8 @@
#include "steamclient_structs.h"
#define TEMP_PATH_BUFFER_LENGTH 4096
#ifdef __cplusplus
extern "C"
{

View file

@ -10260,7 +10260,7 @@ u64_HTML_FileOpenDialog_t::operator w64_HTML_FileOpenDialog_t() const
w64_HTML_FileOpenDialog_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
ret.pchTitle = this->pchTitle;
steamclient_unix_path_to_dos_path(1, this->pchInitialFile, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchInitialFile, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchInitialFile = g_tmppath;
return ret;
}
@ -10281,7 +10281,7 @@ u32_HTML_FileOpenDialog_t::operator w32_HTML_FileOpenDialog_t() const
w32_HTML_FileOpenDialog_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
ret.pchTitle = this->pchTitle;
steamclient_unix_path_to_dos_path(1, this->pchInitialFile, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchInitialFile, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchInitialFile = g_tmppath;
return ret;
}
@ -10333,7 +10333,7 @@ u64_HTML_FinishedRequest_t::operator w64_HTML_FinishedRequest_t() const
{
w64_HTML_FinishedRequest_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchPageTitle = this->pchPageTitle;
return ret;
@ -10354,7 +10354,7 @@ u32_HTML_FinishedRequest_t::operator w32_HTML_FinishedRequest_t() const
{
w32_HTML_FinishedRequest_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchPageTitle = this->pchPageTitle;
return ret;
@ -10520,7 +10520,7 @@ u64_HTML_LinkAtPosition_t::operator w64_HTML_LinkAtPosition_t() const
ret.unBrowserHandle = this->unBrowserHandle;
ret.x = this->x;
ret.y = this->y;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.bInput = this->bInput;
ret.bLiveLink = this->bLiveLink;
@ -10547,7 +10547,7 @@ u32_HTML_LinkAtPosition_t::operator w32_HTML_LinkAtPosition_t() const
ret.unBrowserHandle = this->unBrowserHandle;
ret.x = this->x;
ret.y = this->y;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.bInput = this->bInput;
ret.bLiveLink = this->bLiveLink;
@ -10835,7 +10835,7 @@ u64_HTML_NewWindow_t_132x::operator w64_HTML_NewWindow_t_132x() const
{
w64_HTML_NewWindow_t_132x ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.unX = this->unX;
ret.unY = this->unY;
@ -10864,7 +10864,7 @@ u32_HTML_NewWindow_t_132x::operator w32_HTML_NewWindow_t_132x() const
{
w32_HTML_NewWindow_t_132x ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.unX = this->unX;
ret.unY = this->unY;
@ -10892,7 +10892,7 @@ u64_HTML_NewWindow_t_130x::operator w64_HTML_NewWindow_t_130x() const
{
w64_HTML_NewWindow_t_130x ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.unX = this->unX;
ret.unY = this->unY;
@ -10919,7 +10919,7 @@ u32_HTML_NewWindow_t_130x::operator w32_HTML_NewWindow_t_130x() const
{
w32_HTML_NewWindow_t_130x ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.unX = this->unX;
ret.unY = this->unY;
@ -10966,7 +10966,7 @@ u64_HTML_OpenLinkInNewTab_t::operator w64_HTML_OpenLinkInNewTab_t() const
{
w64_HTML_OpenLinkInNewTab_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
return ret;
}
@ -10985,7 +10985,7 @@ u32_HTML_OpenLinkInNewTab_t::operator w32_HTML_OpenLinkInNewTab_t() const
{
w32_HTML_OpenLinkInNewTab_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
return ret;
}
@ -11097,7 +11097,7 @@ u64_HTML_StartRequest_t::operator w64_HTML_StartRequest_t() const
{
w64_HTML_StartRequest_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchTarget = this->pchTarget;
ret.pchPostData = this->pchPostData;
@ -11122,7 +11122,7 @@ u32_HTML_StartRequest_t::operator w32_HTML_StartRequest_t() const
{
w32_HTML_StartRequest_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchTarget = this->pchTarget;
ret.pchPostData = this->pchPostData;
@ -11246,7 +11246,7 @@ u64_HTML_URLChanged_t::operator w64_HTML_URLChanged_t() const
{
w64_HTML_URLChanged_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchPostData = this->pchPostData;
ret.bIsRedirect = this->bIsRedirect;
@ -11273,7 +11273,7 @@ u32_HTML_URLChanged_t::operator w32_HTML_URLChanged_t() const
{
w32_HTML_URLChanged_t ret;
ret.unBrowserHandle = this->unBrowserHandle;
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, sizeof(g_tmppath), 1);
steamclient_unix_path_to_dos_path(1, this->pchURL, g_tmppath, TEMP_PATH_BUFFER_LENGTH, 1);
ret.pchURL = g_tmppath;
ret.pchPostData = this->pchPostData;
ret.bIsRedirect = this->bIsRedirect;