]> git.saurik.com Git - wxWidgets.git/commitdiff
don't dereference end iterator (closes #10656)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Mar 2009 21:04:55 +0000 (21:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Mar 2009 21:04:55 +0000 (21:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datetimefmt.cpp

index 39f6ddae73c958bf5888690219e4350a0d10d383..91d64529812854cee56afa35f1837809d67531ae 100644 (file)
@@ -910,7 +910,7 @@ wxDateTime::ParseFormat(const wxString& date,
             {
                 // a white space in the format string matches 0 or more white
                 // spaces in the input
-                while ( wxIsspace(*input) )
+                while ( input != end && wxIsspace(*input) )
                 {
                     input++;
                 }
@@ -919,7 +919,7 @@ wxDateTime::ParseFormat(const wxString& date,
             {
                 // any other character (not whitespace, not '%') must be
                 // matched by itself in the input
-                if ( *input++ != *fmt )
+                if ( input == end || *input++ != *fmt )
                 {
                     // no match
                     return false;