Author vstinner
Recipients pitrou, serhiy.storchaka, vstinner
Date 2017-09-04.20:40:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:

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..).

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:00vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka
2017-09-04 20:40:00vstinnersetmessageid: <>
2017-09-04 20:40:00vstinnerlinkissue31339 messages
2017-09-04 20:40:00vstinnercreate