瀏覽代碼

BUG: Result from ostrstream::str() can be a null pointer.

Brad King 23 年之前
父節點
當前提交
dae99c659d
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Source/cmStandardIncludes.h

+ 2 - 1
Source/cmStandardIncludes.h

@@ -181,7 +181,8 @@ public:
       cmStrStreamCleanup cleanup(*this);
       cmStrStreamCleanup::IgnoreUnusedVariable(cleanup);
       int pcount = this->pcount();
-      return std::string(this->Superclass::str(), pcount);
+      const char* ptr = this->Superclass::str();
+      return std::string(ptr?ptr:"", pcount);
     }
 private:
   cmStringStream(const cmStringStream&);