]> granicus.if.org Git - clang/commitdiff
Fix a serious null termination bug found by David Chisnall!
authorChris Lattner <sabre@nondot.org>
Tue, 9 Dec 2008 19:10:54 +0000 (19:10 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Dec 2008 19:10:54 +0000 (19:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 80ef53f5f9c58d435420b01a911b4f699ef9987c..c8fa994916578cdd52f079ac2b1587d6d49749b0 100644 (file)
@@ -959,7 +959,7 @@ llvm::Constant *CodeGenModule::GetAddrOfConstantString(const std::string &str,
 /// character. The result has pointer to array type.
 llvm::Constant *CodeGenModule::GetAddrOfConstantCString(const std::string &str,
                                                         const char *GlobalName){
-  return GetAddrOfConstantString(str + "\0", GlobalName);
+  return GetAddrOfConstantString(str + '\0', GlobalName);
 }
 
 /// EmitObjCPropertyImplementations - Emit information for synthesized