Opened 10 years ago

Closed 5 years ago

#8450 closed Bugs (fixed)

Missing casts in c_local_time_adjustor.hpp lead to year 2038 problem

Reported by: raad@… Owned by: James E. King, III
Milestone: Boost 1.67.0 Component: date_time
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

The duration_rep_type, hour_type and min_type values are not cast to std::time_t, so if they are 32-bit and std::time_t is 64-bit, std::time_t t2 becomes negative for dates after year 2038 and c_time::localtime throws an exception.

With the casts to std::time_t in the attached patch, no exception is thrown.

Attachments (1)

c_local_time_adjustor.hpp.patch (753 bytes ) - added by raad@… 10 years ago.
Patch that fixes the problem

Download all attachments as: .zip

Change History (3)

by raad@…, 10 years ago

Patch that fixes the problem

comment:1 by James E. King, III, 5 years ago

Milestone: To Be DeterminedBoost 1.67.0
Owner: changed from az_sw_dude to James E. King, III
Status: newassigned

comment:2 by James E. King, III, 5 years ago

Resolution: fixed
Status: assignedclosed

Fix merged to master; resolved.

Note: See TracTickets for help on using tickets.