summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qlocale_win.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 3a083582c9..c20827a4ae 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -279,6 +279,9 @@ QVariant QSystemLocalePrivate::dateTimeFormat(QLocale::FormatType type)
QVariant QSystemLocalePrivate::dayName(int day, QLocale::FormatType type)
{
+ if (day < 1 || day > 7)
+ return QString();
+
static const LCTYPE short_day_map[]
= { LOCALE_SABBREVDAYNAME1, LOCALE_SABBREVDAYNAME2,
LOCALE_SABBREVDAYNAME3, LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5,