Browse Source

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

Brad King 23 năm trước cách đây
mục cha
commit
dae99c659d
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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&);