Message301257
Oh, I forgot to describe the bug.
asctime() (and ctime()?) do crash on year > 9999 with musl. musl uses an hardcoded buffer of 26 bytes:
http://git.musl-libc.org/cgit/musl/tree/src/time/__asctime.c
musl developers consider that the caller must reject year larger than 9999:
/* ISO C requires us to use the above format string,
* even if it will not fit in the buffer. Thus asctime_r
* is _supposed_ to crash if the fields in tm are too large.
* We follow this behavior and crash "gracefully" to warn
* application developers that they may not be so lucky
* on other implementations (e.g. stack smashing..).
*/
a_crash();
I disagree. asctime() must either return a longer string, or return an error. But not crash. |
|
Date |
User |
Action |
Args |
2017-09-04 20:40:00 | vstinner | set | recipients:
+ vstinner, pitrou, serhiy.storchaka |
2017-09-04 20:40:00 | vstinner | set | messageid: <1504557600.3.0.261008302397.issue31339@psf.upfronthosting.co.za> |
2017-09-04 20:40:00 | vstinner | link | issue31339 messages |
2017-09-04 20:40:00 | vstinner | create | |
|