From df64cbd15097321c51582cf0a11af0f6121b0dd4 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 2 Dec 2015 07:00:52 -0500 Subject: Avoid ever returning 0 from CPUID::cache_line_size Take the value from build.h if we have no way of getting it dynamically. Fixes an infinite loop in AES on non-x86 introduced in ebf2164a, as otherwise it does for(size_t i = 0; i != ...; i += 0) {} while iterating over the TE tables. --- src/lib/utils/cpuid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/utils') diff --git a/src/lib/utils/cpuid.cpp b/src/lib/utils/cpuid.cpp index c98829789..695a28550 100644 --- a/src/lib/utils/cpuid.cpp +++ b/src/lib/utils/cpuid.cpp @@ -74,7 +74,7 @@ namespace Botan { u64bit CPUID::g_x86_processor_flags[2] = { 0, 0 }; -size_t CPUID::g_cache_line_size = 0; +size_t CPUID::g_cache_line_size = BOTAN_TARGET_CPU_DEFAULT_CACHE_LINE_SIZE; bool CPUID::g_altivec_capable = false; bool CPUID::g_initialized = false; -- cgit v1.2.3