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>
This commit is contained in:
Edward Welbourne 2016-01-18 12:42:49 +01:00
parent d8c0bd4207
commit aa196457da

View File

@ -382,7 +382,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat)
++add; ++add;
if (status != quote) { if (status != quote) {
status = quote; status = quote;
} else if (newFormat.at(i - 1) != slash) { } else if (i > 0 && newFormat.at(i - 1) != slash) {
status = zero; status = zero;
} }
} else if (status != quote) { } else if (status != quote) {