소스 검색

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&);