Fix (unreported) buffer overflow in BLI_system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++ string expect a NULL-terminated C-string, we need an extra char to ensure last one is always NULL. See D8906. Thanks to @brecht for noting this one too.
This commit is contained in:
parent
d067c13a9d
commit
fa2ef64d96
|
@ -135,7 +135,7 @@ static void __cpuid(
|
|||
|
||||
char *BLI_cpu_brand_string(void)
|
||||
{
|
||||
char buf[48] = {0};
|
||||
char buf[49] = {0};
|
||||
int result[4] = {0};
|
||||
__cpuid(result, 0x80000000);
|
||||
if (result[0] >= (int)0x80000004) {
|
||||
|
|
Loading…
Reference in New Issue