From aa196457da54d007dc443e81f200a62f10f7b915 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 18 Jan 2016 12:42:49 +0100 Subject: Avoid dereferencing before the start of a string. A check for a backslash before a quote neglected to pretest that the quote wasn't the first character in its string. Change-Id: Ib5226836d1111e37bed984938f7c667be59eb1c5 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetimeparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 0832cd0eed..99a324a728 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -382,7 +382,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) ++add; if (status != quote) { status = quote; - } else if (newFormat.at(i - 1) != slash) { + } else if (i > 0 && newFormat.at(i - 1) != slash) { status = zero; } } else if (status != quote) { -- cgit v1.2.3