From fa2ef64d961959e46d35ff11d50cfc8f7bdf484a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 16 Sep 2020 15:02:02 +0200 Subject: 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. --- source/blender/blenlib/intern/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/intern/system.c') diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c index e3572b7f05e..8e3d489fbb3 100644 --- a/source/blender/blenlib/intern/system.c +++ b/source/blender/blenlib/intern/system.c @@ -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) { -- cgit v1.2.3