[cfe-commits] r159306 - /cfe/trunk/lib/Edit/Commit.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jun 27 16:45:44 PDT 2012
Author: akirtzidis
Date: Wed Jun 27 18:45:44 2012
New Revision: 159306
URL: http://llvm.org/viewvc/llvm-project?rev=159306&view=rev
Log:
Fix uninitialized variable use bug found by the clairvoyant static analyzer.
Commit::canReplaceText would not initialize its out 'Len' parameter before
returning true and it would be used uninitialized in Commit::replaceText.
Modified:
cfe/trunk/lib/Edit/Commit.cpp
Modified: cfe/trunk/lib/Edit/Commit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/Commit.cpp?rev=159306&r1=159305&r2=159306&view=diff
==============================================================================
--- cfe/trunk/lib/Edit/Commit.cpp (original)
+++ cfe/trunk/lib/Edit/Commit.cpp Wed Jun 27 18:45:44 2012
@@ -332,6 +332,7 @@
if (invalidTemp)
return false;
+ Len = text.size();
return file.substr(Offs.getOffset()).startswith(text);
}
More information about the cfe-commits
mailing list