aboutsummaryrefslogtreecommitdiff
path: root/lib/Edit
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-27 23:45:44 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-27 23:45:44 +0000
commitaf505c58222a87058fa4ac26cd8da27c141eec42 (patch)
tree037b02388d1c70bdca216d8ffa1d35464643e0e8 /lib/Edit
parent8bdb58a7835a9a90dd9b9791fccf269cbc1dcef3 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Edit')
-rw-r--r--lib/Edit/Commit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Edit/Commit.cpp b/lib/Edit/Commit.cpp
index c45ee1f850..41c72e42e6 100644
--- a/lib/Edit/Commit.cpp
+++ b/lib/Edit/Commit.cpp
@@ -332,6 +332,7 @@ bool Commit::canReplaceText(SourceLocation loc, StringRef text,
if (invalidTemp)
return false;
+ Len = text.size();
return file.substr(Offs.getOffset()).startswith(text);
}