From 77888147e5555d2599536e4ec94ea251ffbe2c9f Mon Sep 17 00:00:00 2001 From: Prashanth Swaminathan Date: Thu, 11 Jan 2024 09:28:55 -0800 Subject: [PATCH] Upgrade to warning when name is truncated Signal to users that the name field may not produce the expected string if the chipset name and revision exceeds the maximum size of the buffer. In practice, this is unlikely as the buffer size is reasonably high for a chipset name/revision. --- src/arm/linux/cpuinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arm/linux/cpuinfo.c b/src/arm/linux/cpuinfo.c index 2afd6cba..081d9aab 100644 --- a/src/arm/linux/cpuinfo.c +++ b/src/arm/linux/cpuinfo.c @@ -873,7 +873,7 @@ static bool parse_line( } else if (memcmp(line_start, "Hardware", key_length) == 0) { size_t value_length = value_end - value_start; if (value_length > CPUINFO_HARDWARE_VALUE_MAX) { - cpuinfo_log_info( + cpuinfo_log_warning( "length of Hardware value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit", (int)value_length, value_start, @@ -888,7 +888,7 @@ static bool parse_line( } else if (memcmp(line_start, "Revision", key_length) == 0) { size_t value_length = value_end - value_start; if (value_length > CPUINFO_REVISION_VALUE_MAX) { - cpuinfo_log_info( + cpuinfo_log_warning( "length of Revision value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit", (int)value_length, value_start,