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: sascha.zelzer@… 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;

Change History (2)

comment:2 by Marshall Clow, 6 years ago

Applied the PR. Will walt for tests to cycle.

Note: See TracTickets for help on using tickets.