QLocale - Check day number is valid
Check day number falls in valid range before using as array index. Change-Id: I8d7c203b97988633fe4c345d5e7002bba9c2c68b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
f2f2e4e53e
commit
46de0c4765
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue