summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-08-08 17:32:45 +0000
committerAlexey Samsonov <samsonov@google.com>2013-08-08 17:32:45 +0000
commit783a0387c5eef62ff50950aa3e977b2652a3c3a5 (patch)
tree4aba83eec46eeced2a36f5ddc8db20983918277b /lib
parent014773626d2678868adf696ac58c44d2b2980fa8 (diff)
downloadllvm-783a0387c5eef62ff50950aa3e977b2652a3c3a5.tar.gz
llvm-783a0387c5eef62ff50950aa3e977b2652a3c3a5.tar.bz2
llvm-783a0387c5eef62ff50950aa3e977b2652a3c3a5.tar.xz
Fix off-by-one error in Regex::isValid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Regex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Regex.cpp b/lib/Support/Regex.cpp
index dec967e33f..5413641840 100644
--- a/lib/Support/Regex.cpp
+++ b/lib/Support/Regex.cpp
@@ -43,7 +43,7 @@ bool Regex::isValid(std::string &Error) {
size_t len = llvm_regerror(error, preg, NULL, 0);
- Error.resize(len);
+ Error.resize(len - 1);
llvm_regerror(error, preg, &Error[0], len);
return false;
}