diff options
author | Benny Baumann <BenBE@geshi.org> | 2023-07-28 13:01:39 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2023-07-28 13:01:39 +0200 |
commit | 914d92dc3a2f3d0f3065abf52ba3da557910ee76 (patch) | |
tree | ea0c21ec4f71a0f37665e6ad277cd618168a51f4 /darwin | |
parent | 958057f01ab304f9effb716668084d5c2f92ffec (diff) |
Avoid VLA on Darwin when reading CPU brand
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/PlatformHelpers.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/darwin/PlatformHelpers.c b/darwin/PlatformHelpers.c index 97f0741a..a4ea82be 100644 --- a/darwin/PlatformHelpers.c +++ b/darwin/PlatformHelpers.c @@ -103,9 +103,8 @@ double Platform_calculateNanosecondsPerMachTick(void) { * the "Apple M1" chip specifically when running under Rosetta 2. */ - size_t cpuBrandStringSize = 1024; - char cpuBrandString[cpuBrandStringSize]; - Platform_getCPUBrandString(cpuBrandString, cpuBrandStringSize); + char cpuBrandString[1024] = ""; + Platform_getCPUBrandString(cpuBrandString, sizeof(cpuBrandString)); bool isRunningUnderRosetta2 = Platform_isRunningTranslated(); |