From 9caa63d5b2329237ce81d0065dd59a08100b385b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 13 Nov 2022 13:46:36 -0800 Subject: [PATCH] ELFCodeLoader: Fixes AT_PLATFORM null terminator We were failing to null terminate the platform which is causing strcmp to fail. --- Source/Tests/ELFCodeLoader2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Tests/ELFCodeLoader2.h b/Source/Tests/ELFCodeLoader2.h index 49ddc36a2..9a430294a 100644 --- a/Source/Tests/ELFCodeLoader2.h +++ b/Source/Tests/ELFCodeLoader2.h @@ -832,7 +832,8 @@ class ELFCodeLoader2 final : public FEXCore::CodeLoader { static constexpr std::string_view platform_name_x86_64 = "x86_64"; static constexpr std::string_view platform_name_i686 = "i686"; - static constexpr size_t platform_string_max_size = std::max(platform_name_x86_64.size(), platform_name_i686.size()); + // Need to include null character. + static constexpr size_t platform_string_max_size = std::max(platform_name_x86_64.size(), platform_name_i686.size()) + 1; FEX_CONFIG_OPT(AdditionalArguments, ADDITIONALARGUMENTS); };