Don't dereference invalid iterator in wxDateTime::ParseDate().

If the string passed to this method contained only spaces (possibly 0 of them,
i.e. was empty) we would dereference the end string iterator. Fix this by
adding an explicit test for "p != pEnd".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-01-04 10:59:40 +00:00
parent ba2279bbef
commit 462f4f19b5

View File

@ -1559,7 +1559,7 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
const wxString::const_iterator pEnd = date.end();
wxString::const_iterator p = pBegin;
while ( wxIsspace(*p) )
while ( p != pEnd && wxIsspace(*p) )
p++;
// some special cases