Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/msvcrt/time.c | 2 ++ dlls/ucrtbase/tests/misc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 127a2164b8..84e725747f 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1405,6 +1405,8 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, return 0; break; case 'u': + if(!MSVCRT_CHECK_PMT(mstm->tm_wday>=0 && mstm->tm_wday<=6)) + goto einval_error; tmp = mstm->tm_wday ? mstm->tm_wday : 7; if(!strftime_int(str, &ret, max, tmp, 0, 1, 7)) return 0; diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index c242546a80..93a78a5de7 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -959,11 +959,11 @@ static void test_strftime(void) {"%#R", "0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, {"%T", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, {"%#T", "0:0:0", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, - {"%u", "", { 0, 0, 0, 1, 0, 117, -1, 0, 0 }, FALSE, TRUE}, + {"%u", "", { 0, 0, 0, 1, 0, 117, -1, 0, 0 }}, {"%u", "7", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, {"%u", "1", { 0, 0, 0, 1, 0, 117, 1, 0, 0 }}, {"%u", "6", { 0, 0, 0, 1, 0, 117, 6, 0, 0 }}, - {"%u", "", { 0, 0, 0, 1, 0, 117, 7, 0, 0 }, TRUE}, + {"%u", "", { 0, 0, 0, 1, 0, 117, 7, 0, 0 }}, {"%h", "Jan", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, {"%I", "", { 0, 0, -1, 1, 0, 70, 4, 0, 0 }}, {"%I", "12", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},