changeset: 97732:f185917498ca branch: 3.4 parent: 97720:7a9dddc11f2e user: Steve Dower date: Sun Sep 06 22:18:36 2015 -0700 files: Misc/NEWS Modules/timemodule.c description: Issue #24917: time_strftime() buffer over-read. diff -r 7a9dddc11f2e -r f185917498ca Misc/NEWS --- a/Misc/NEWS Mon Sep 07 02:57:47 2015 +0000 +++ b/Misc/NEWS Sun Sep 06 22:18:36 2015 -0700 @@ -81,6 +81,8 @@ Library ------- +- Issue #24917: time_strftime() buffer over-read. + - Issue #23144: Make sure that HTMLParser.feed() returns all the data, even when convert_charrefs is True. diff -r 7a9dddc11f2e -r f185917498ca Modules/timemodule.c --- a/Modules/timemodule.c Mon Sep 07 02:57:47 2015 +0000 +++ b/Modules/timemodule.c Sun Sep 06 22:18:36 2015 -0700 @@ -655,6 +655,8 @@ outbuf != NULL; outbuf = wcschr(outbuf+2, '%')) { + if (outbuf[1] == L'\0') + break; /* Issue #19634: On AIX, wcsftime("y", (1899, 1, 1, 0, 0, 0, 0, 0, 0)) returns "0/" instead of "99" */ if (outbuf[1] == L'y' && buf.tm_year < 0) {