Skip to content

Commit 434970b

Browse files
Upgrade to warning when name is truncated (#216)
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.
1 parent 9321265 commit 434970b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arm/linux/cpuinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ static bool parse_line(
873873
} else if (memcmp(line_start, "Hardware", key_length) == 0) {
874874
size_t value_length = value_end - value_start;
875875
if (value_length > CPUINFO_HARDWARE_VALUE_MAX) {
876-
cpuinfo_log_info(
876+
cpuinfo_log_warning(
877877
"length of Hardware value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit",
878878
(int)value_length,
879879
value_start,
@@ -888,7 +888,7 @@ static bool parse_line(
888888
} else if (memcmp(line_start, "Revision", key_length) == 0) {
889889
size_t value_length = value_end - value_start;
890890
if (value_length > CPUINFO_REVISION_VALUE_MAX) {
891-
cpuinfo_log_info(
891+
cpuinfo_log_warning(
892892
"length of Revision value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit",
893893
(int)value_length,
894894
value_start,

0 commit comments

Comments
 (0)