fix strftime handling of out-of-range struct tm fields
authorRich Felker <dalias@aerifal.cx>
Wed, 14 Oct 2015 22:58:15 +0000 (18:58 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 14 Oct 2015 22:58:15 +0000 (18:58 -0400)
commit8d93cb57754f1f81f8e15bb74afd1725cead45c2
treeb7a3a82bcdc031f34180c168726cd08e3ee7600b
parent6fef8cafbd0f6f185897bc87feb1ff66e2e204e1
fix strftime handling of out-of-range struct tm fields

strftime results are unspecified in this case, but should not invoke
undefined behaviour.

tm_wday, tm_yday, tm_mon and tm_year fields were used in signed int
arithmetic that could overflow.

based on patch by Szabolcs Nagy.
src/time/strftime.c