summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@theqtcompany.com>2016-01-18 12:42:49 +0100
committerEdward Welbourne <edward.welbourne@theqtcompany.com>2016-01-20 17:12:48 +0000
commitaa196457da54d007dc443e81f200a62f10f7b915 (patch)
tree0dd2bd9ba91a9387ea1d177da1b289d5a4670b40 /src/corelib/tools
parentd8c0bd4207d5f63d3f47353f8d9c9e6963a24355 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp2
1 files changed, 1 insertions, 1 deletions
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) {