Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-09-16 15:37:03 +0300
committerBastien Montagne <bastien@blender.org>2020-09-16 15:39:13 +0300
commitbe11603dc224345a1b75e8cdf7b0c5396db0d94d (patch)
tree001b1d835b74dfed4c382d14ff0a0cd26b1875f2 /intern/cycles
parentf14995aba70a46e2629faab6a2d74aef53205d90 (diff)
Fix (unreported) buffer overflow in Cycles' 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. Found while investigating T80657.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/util/util_system.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 6d32153209a..2c1716ce515 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -166,7 +166,7 @@ static void __cpuid(int data[4], int selector)
string system_cpu_brand_string()
{
- char buf[48] = {0};
+ char buf[49] = {0};
int result[4] = {0};
__cpuid(result, 0x80000000);