OSDN Git Service

Use c_str() to force the string to be nul-terminated.
authorDan Gohman <gohman@apple.com>
Fri, 6 Mar 2009 18:13:15 +0000 (18:13 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 6 Mar 2009 18:13:15 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66279 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/PrettyStackTrace.cpp

index 727f9a8..77ae584 100644 (file)
@@ -66,7 +66,7 @@ static void CrashHandler(void *Cookie) {
   }
   
   if (!TmpStr.empty()) {
-    __crashreporter_info__ = strdup(&TmpStr[0]);
+    __crashreporter_info__ = strdup(TmpStr.c_str());
     errs() << __crashreporter_info__;
     errs().flush();
   }