Skip to content

Commit 403d652

Browse files
authored
Fix overread asan error of brand_string (#344)
- Brand string is 3 rows of cpuid which is 48 bytes. - Allow for CPUINFO_PACKAGE_NAME_MAX to be 64 bytes for benefit of Oryon
1 parent f858c30 commit 403d652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/x86/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void cpuinfo_x86_init_processor(struct cpuinfo_x86_processor* processor) {
7272
for (uint32_t i = 0; i < 3; i++) {
7373
brand_string[i] = cpuid(UINT32_C(0x80000002) + i);
7474
}
75-
memcpy(processor->brand_string, brand_string, sizeof(processor->brand_string));
75+
memcpy(processor->brand_string, brand_string, sizeof(brand_string));
7676
cpuinfo_log_debug("raw CPUID brand string: \"%48s\"", processor->brand_string);
7777
}
7878
}

0 commit comments

Comments
 (0)