diff options
author | Bastien Montagne <bastien@blender.org> | 2020-09-16 16:02:02 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-09-16 16:04:19 +0300 |
commit | fa2ef64d961959e46d35ff11d50cfc8f7bdf484a (patch) | |
tree | cf29d92ad7ff9a8bed832eaceca2cb7b8d664584 /source/blender/blenlib/intern/system.c | |
parent | d067c13a9d07c7b2d21aa75a93d95d42e0609aa0 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/intern/system.c')
-rw-r--r-- | source/blender/blenlib/intern/system.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |