Opened 6 years ago
Last modified 6 years ago
#12180 new Bugs
Date time parsing with a particular format string dereferences an end iterator
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | To Be Determined | Component: | date_time |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
Using the "%s" format flag with an input string that does not end with fractional seconds leads to dereferencing of an "end" iterator, causing memory corruption.
Sample code:
std::string fmt = "%Y-%m-%d %H:%M:%s"; std::stringstream ss; ss.imbue(std::locale(ss.getloc(), new boost::posix_time::time_input_facet(fmt))); ss << "2010-05-10 10:03:05"; boost::posix_time::ptime pt; ss >> pt;
Note:
See TracTickets
for help on using tickets.
See GitHub PR https://github.com/boostorg/date_time/pull/32