From 3a96ade423a76b95d5829a74eeaf8408f9bb7e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 13 Feb 2024 19:08:38 +0800 Subject: [PATCH] CPU (Linux): don't segfault if we fail to find `Vendor ID` in `lscpu` Fix #718 --- src/detection/cpu/cpu_linux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/detection/cpu/cpu_linux.c b/src/detection/cpu/cpu_linux.c index acb577a5a..4446f0458 100644 --- a/src/detection/cpu/cpu_linux.c +++ b/src/detection/cpu/cpu_linux.c @@ -266,6 +266,10 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) return NULL; } } + else + { + pstart = buffer.chars; + } } while ((pstart = strstr(pstart, "Model name:")))