From e12f3631d4bcb60423b44ab2c433838a36f41c46 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 3 Jul 2026 15:37:38 +0800 Subject: [PATCH] OS (Linux): fixes potencial issue --- src/detection/os/os_linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index 6bdb37b9d..9e1fcef37 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -332,7 +332,9 @@ FF_A_UNUSED static void detectDeepinEnhancement(FFOSResult* result) { FF_A_UNUSED static void detectAstraVersion(FFOSResult* result) { // `PRETTY_NAME` is just `Astra Linux`; the version is in `VERSION_ID`, e.g. `2.12_x86-64` - ffStrbufAppendSUntilC(&result->version, result->versionID.chars, '_'); + if (result->version.length == 0) { // Should be empty. Just in case + ffStrbufAppendSUntilC(&result->version, result->versionID.chars, '_'); + } if (result->version.length > 0) { ffStrbufAppendC(&result->prettyName, ' '); ffStrbufAppend(&result->prettyName, &result->version);