From 58f436d8a209c24c9ac53436e6cbedeb7b29e016 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Wed, 7 Sep 2022 06:40:47 -0700 Subject: [PATCH] Apple GPU: Set length of name buffer --- src/detection/gpu/gpu_apple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index fb4a54023..c6a2ea743 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -59,7 +59,8 @@ void ffDetectGPUImpl(FFlist* gpus, const FFinstance* instance) uint32_t modelLength = (uint32_t) ffCFStringGetLength(model); ffStrbufInitA(&gpu->name, modelLength + 1); ffCFStringGetCString(model, gpu->name.chars, modelLength + 1, kCFStringEncodingUTF8); - gpu->name.chars[modelLength] = '\0'; + gpu->name.length = modelLength; + gpu->name.chars[gpu->name.length] = '\0'; ffStrbufInitA(&gpu->vendor, 0); ffStrbufInitA(&gpu->driver, 0);