From f2a29309f33f3923d2e7d275be209c2257ad5927 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Thu, 11 Dec 2025 09:50:35 +0800 Subject: [PATCH] CPU (Linux): prevents variables from integer overflow --- src/detection/cpu/cpu_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/cpu/cpu_linux.c b/src/detection/cpu/cpu_linux.c index 3e6b8832f..9edcac48f 100644 --- a/src/detection/cpu/cpu_linux.c +++ b/src/detection/cpu/cpu_linux.c @@ -862,9 +862,9 @@ FF_MAYBE_UNUSED static uint16_t getLoongarchPropCount(FFstrbuf* cpuinfo, const c char* pend; unsigned long id = strtoul(p, &pend, 10); if (__builtin_expect(id > 64, false)) - high |= 1 << (id - 64); + high |= 1UL << (id - 64); else - low |= 1 << id; + low |= 1UL << id; p = pend; }