File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 4141#include < codecvt>
4242#include < vector>
4343#include < iostream>
44+ #include < limits>
4445
4546
4647// #include "eos_minimum_includes.h"
@@ -1375,11 +1376,18 @@ void eos_create(EOSConfig& eosConfig)
13751376 steamApiInterfaceVersionsAsCharArray.push_back (' \0 ' );
13761377
13771378 steam_platform.SteamApiInterfaceVersionsArray = reinterpret_cast <char *>(steamApiInterfaceVersionsAsCharArray.data ());
1379+
1380+ auto size = steamApiInterfaceVersionsAsCharArray.size ();
1381+
1382+ if (size > (std::numeric_limits<uint32_t >::max)()) {
1383+ log_error (" Size given for SteamApiInterfaceVersionsAsCharArray exceeds the maximum value for uint32_t." );
1384+ throw std::overflow_error (" Size exceeds the maximum value for uint32_t" );
1385+ }
13781386
13791387 // steam_platform needs to have a count of how many bytes the "array" is, stored in SteamApiInterfaceVersionsArrayBytes
13801388 // This has some fuzzy behavior; if you set it to 0 or count it up properly, there won't be a logged problem
13811389 // if you put a non-zero amount that is insufficient, there will be an unclear logged error message
1382- steam_platform.SteamApiInterfaceVersionsArrayBytes = steamApiInterfaceVersionsAsCharArray. size ( );
1390+ steam_platform.SteamApiInterfaceVersionsArrayBytes = static_cast < uint32_t >(size );
13831391
13841392 steam_integrated_platform_option.ApiVersion = EOS_INTEGRATEDPLATFORM_OPTIONS_API_LATEST;
13851393 steam_integrated_platform_option.Type = EOS_IPT_Steam;
You can’t perform that action at this time.
0 commit comments