From: Nathan Moinvaziri Date: Tue, 13 Jan 2026 03:11:00 +0000 (-0800) Subject: Check for null return value from getauxval(AT_PLATFORM) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95269ad8d31998f858c238347a4a5dc9676ba991;p=thirdparty%2Fzlib-ng.git Check for null return value from getauxval(AT_PLATFORM) --- diff --git a/arch/arm/arm_features.c b/arch/arm/arm_features.c index 7eb43d128..d5eece1a3 100644 --- a/arch/arm/arm_features.c +++ b/arch/arm/arm_features.c @@ -207,9 +207,10 @@ static inline int arm_has_simd(void) { int has_simd = 0; #if defined(__linux__) && defined(HAVE_SYS_AUXV_H) const char *platform = (const char *)getauxval(AT_PLATFORM); - has_simd = strncmp(platform, "v6l", 3) == 0 + has_simd = platform + && (strncmp(platform, "v6l", 3) == 0 || strncmp(platform, "v7l", 3) == 0 - || strncmp(platform, "v8l", 3) == 0; + || strncmp(platform, "v8l", 3) == 0); #elif defined(ARM_NOCHECK_SIMD) has_simd = 1; #endif