Opened 12 years ago

Closed 12 years ago

#10656 closed defect (fixed)

wxDateTime::ParseFormat dereferences out-of-bound iterator

Reported by: aradke Owned by:
Priority: normal Milestone:
Component: base Version: stable-latest
Keywords: wxDateTime ParseFormat Cc:
Blocked By: Blocking:
Patch: yes


In my application, the following call fails with a debug message from the Microsoft Visual C++ library:

wxDateTime().ParseDateTime("03/23/2009 11:41:05");

The problem is that wxDateTime::ParseFormat ends up dereferencing an out-of-bound string iterator while trying to match a format string containing whitespace to the target string. I have attached a fix for this issue.

Attachments (1)

invalid string iterator dereferencing in wxDateTime.diff download (875 bytes) - added by aradke 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by vadz

  • Resolution set to outdated
  • Status changed from new to closed

This should have been fixed a couple of days and revisions ago, please retest with latest trunk and reopen if the problem persists.


comment:2 Changed 12 years ago by aradke

  • Resolution outdated deleted
  • Status changed from closed to reopened

Sorry, I should have been more specific in my original bug report...

I tested and made the patch against r59914 of datetimefmt.cpp which is still current as of this writing. I believe this issue is similar to the one that was fixed earlier, but in a different location in the code.

comment:3 Changed 12 years ago by vadz

  • Patch set

Oops, I definitely should have been more careful, I looked at the first line of the patch only and somehow thought that it was the change that I had already done but it's, of course, a different one. Sorry again and I'll apply the patch in a moment, thanks!

comment:4 Changed 12 years ago by VZ

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [59928]) don't dereference end iterator (closes #10656)

Note: See TracTickets for help on using tickets.