diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-17 18:18:22 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-18 15:12:18 +0100 |
commit | cef5754641d66825fb4094b5f480ce17184e8649 (patch) | |
tree | 3e45a6dcc48e14c7f01fbe7ec2a6e05da88ce5bd /src/shared | |
parent | f1d618ab5be8e05525a8dc3f63fcc50075ffe182 (diff) | |
download | qt-creator-cef5754641d66825fb4094b5f480ce17184e8649.tar.gz |
fix read beyond end of input line
a line ending in two backslashes would produce a literal backslash and
run off the end.
Task-number: QTCREATORBUG-3360
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/proparser/profileparser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/proparser/profileparser.cpp b/src/shared/proparser/profileparser.cpp index 0fd6163200..977fa1bad1 100644 --- a/src/shared/proparser/profileparser.cpp +++ b/src/shared/proparser/profileparser.cpp @@ -422,7 +422,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in) } while (c == ' ' || c == '\t'); forever { if (c == '$') { - if (*cur == '$') { // may be EOF, EOL, WS or '#' if past end + if (*cur == '$') { // may be EOF, EOL, WS, '#' or '\\' if past end cur++; if (putSpace) { putSpace = false; @@ -541,7 +541,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in) xprPtr = ptr; goto nextChr; } - } else if (c == '\\') { + } else if (c == '\\' && cur != end) { static const char symbols[] = "[]{}()$\\'\""; ushort c2 = *cur; if (!(c2 & 0xff00) && strchr(symbols, c2)) { |