diff options
| author | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-01-18 12:42:49 +0100 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-01-20 17:12:48 +0000 |
| commit | aa196457da54d007dc443e81f200a62f10f7b915 (patch) | |
| tree | 0dd2bd9ba91a9387ea1d177da1b289d5a4670b40 /src | |
| parent | d8c0bd4207d5f63d3f47353f8d9c9e6963a24355 (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')
| -rw-r--r-- | src/corelib/tools/qdatetimeparser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 0832cd0eeda..99a324a728b 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) { |
