From: Francisco Jerez Date: Mon, 18 Aug 2014 12:25:35 +0000 (+0300) Subject: clover/util: Null-terminate the result of compat::string::c_str(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4539274b6478249d52e99fa34243daacf48be80;p=mesa.git clover/util: Null-terminate the result of compat::string::c_str(). Reported-by: EdB --- 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 *