Check for end of string when parsing "%z" in wxDateTime::Format().
We could dereference an invalid iterator when parsing "%z", check for this in the code and add a unit test for this case. Closes #14075. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -829,6 +829,9 @@ void DateTimeTestCase::TestTimeFormat()
|
||||
CPPUNIT_ASSERT( dt.ParseFormat("17", "%d") );
|
||||
CPPUNIT_ASSERT_EQUAL( 17, dt.GetDay() );
|
||||
|
||||
// test some degenerate cases
|
||||
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );
|
||||
|
||||
// test compilation of some calls which should compile (and not result in
|
||||
// ambiguity because of char*<->wxCStrData<->wxString conversions)
|
||||
wxString s("foo");
|
||||
|
Reference in New Issue
Block a user