From f98ee23415719f4475786b9d6b8419983d28409a Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Sun, 12 Jul 2015 19:39:51 -0600 Subject: [PATCH] Fix incorrect used of snprintf() --- SPIRV/GlslangToSpv.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index a3b937a..ce37085 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -2545,8 +2545,9 @@ namespace glslang { void GetSpirvVersion(std::string& version) { - char buf[10]; - snprintf(buf, "0.%d", spv::Version); + const int bufSize = 10; + char buf[bufSize]; + snprintf(buf, bufSize, "0.%d", spv::Version); version = buf; } -- 2.7.4