This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, serhiy.storchaka, vstinner
Date 2017-09-04.20:40:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504557600.3.0.261008302397.issue31339@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-09-04 20:40:00vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka
2017-09-04 20:40:00vstinnersetmessageid: <1504557600.3.0.261008302397.issue31339@psf.upfronthosting.co.za>
2017-09-04 20:40:00vstinnerlinkissue31339 messages
2017-09-04 20:40:00vstinnercreate