summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2023-07-28 13:01:39 +0200
committerBenny Baumann <BenBE@geshi.org>2023-07-28 13:01:39 +0200
commit914d92dc3a2f3d0f3065abf52ba3da557910ee76 (patch)
treeea0c21ec4f71a0f37665e6ad277cd618168a51f4 /darwin
parent958057f01ab304f9effb716668084d5c2f92ffec (diff)
Avoid VLA on Darwin when reading CPU brand
Diffstat (limited to 'darwin')
-rw-r--r--darwin/PlatformHelpers.c5
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();

© 2014-2024 Faster IT GmbH | imprint | privacy policy