]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: ARM64 CRC32: Add error checking to FreeBSD-specific code
authorLasse Collin <lasse.collin@tukaani.org>
Wed, 10 Apr 2024 18:59:27 +0000 (21:59 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 10 Apr 2024 20:12:23 +0000 (23:12 +0300)
Also add parenthesis to the return statement.

I didn't test this.

Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
src/liblzma/check/crc32_arm64.h

index cd1b355fd65ff9411fe8bd9cf60e7bffda5298ad..68e7fcdd51bf876c832fad84906087e6d36f69cc 100644 (file)
@@ -84,8 +84,10 @@ is_arch_extension_supported(void)
 #elif defined(HAVE_ELF_AUX_INFO)
        unsigned long feature_flags;
 
-       elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags));
-       return feature_flags & HWCAP_CRC32 != 0;
+       if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0)
+               return false;
+
+       return (feature_flags & HWCAP_CRC32) != 0;
 
 #elif defined(_WIN32)
        return IsProcessorFeaturePresent(