clover/util: Null-terminate the result of compat::string::c_str().
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 18 Aug 2014 12:25:35 +0000 (15:25 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 5 Sep 2014 06:27:20 +0000 (09:27 +0300)
Reported-by: EdB <edb+mesa@sigluy.net>
src/gallium/state_trackers/clover/util/compat.hpp

index e0ab965eee6dd25d02bcdb2f11a837586335ab27..7305577529317a9eb6bb4b1cba5d04a63cc7dcf2 100644 (file)
@@ -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 *