Fix crashes in wxDateTime::ParseDate() for some invalid dates.
Parsing an incomplete date with nothing but whitespace and/or date delimiter characters at the end crashed as we happily went beyond the end of string. Fix this by not using a loop which didn't check for the iterator validity. Closes #12685. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1625,9 +1625,10 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
|
||||
while ( p != pEnd )
|
||||
{
|
||||
// skip white space and date delimiters
|
||||
while ( wxStrchr(".,/-\t\r\n ", *p) )
|
||||
if ( wxStrchr(".,/-\t\r\n ", *p) )
|
||||
{
|
||||
++p;
|
||||
continue;
|
||||
}
|
||||
|
||||
// modify copy of the iterator as we're not sure if the next token is
|
||||
|
||||
Reference in New Issue
Block a user