From b4539274b6478249d52e99fa34243daacf48be80 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 18 Aug 2014 15:25:35 +0300 Subject: clover/util: Null-terminate the result of compat::string::c_str(). Reported-by: EdB --- src/gallium/state_trackers/clover/util/compat.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/clover/util') diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp index e0ab965eee6..73055775293 100644 --- a/src/gallium/state_trackers/clover/util/compat.hpp +++ b/src/gallium/state_trackers/clover/util/compat.hpp @@ -361,7 +361,9 @@ namespace clover { const char * c_str() const { - return begin(); + v.reserve(size() + 1); + *v.end() = 0; + return v.begin(); } const char * -- cgit v1.2.3