Просмотр исходного кода

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

Brad King 23 лет назад
Родитель
Сommit
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&);