From cef5754641d66825fb4094b5f480ce17184e8649 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Jan 2011 18:18:22 +0100 Subject: 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 --- src/shared/proparser/profileparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/shared/proparser/profileparser.cpp') 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)) { -- cgit v1.2.1