From 126c1a10bbd6b2692f9b2b8b782e8d27dee59a6c Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Fri, 9 Sep 2022 17:48:55 +0200 Subject: [PATCH] Correctly handle GPU names with multiple ']' --- src/detection/gpu/gpu_linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 5ba813035..21d238e2b 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -90,8 +90,7 @@ static void pciDetectDeviceName(FFGPUResult* gpu, PCIData* pci, struct pci_dev* ffStrbufRecalculateLength(&gpu->name); uint32_t openingBracket = ffStrbufFirstIndexC(&gpu->name, '['); - uint32_t closingBracket = ffStrbufFirstIndexC(&gpu->name, ']'); - + uint32_t closingBracket = ffStrbufLastIndexC(&gpu->name, ']'); if(openingBracket < closingBracket && closingBracket < gpu->name.length) { ffStrbufSubstrBefore(&gpu->name, closingBracket);