From dae99c659d25f4a6be7f99df51a83186cb5aa155 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 25 Jun 2002 09:18:43 -0400 Subject: [PATCH] BUG: Result from ostrstream::str() can be a null pointer. --- Source/cmStandardIncludes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 802855c09..224e19671 100644 --- a/Source/cmStandardIncludes.h +++ b/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&);