Avoid invalid memory access in QIconCacheGtkReader::lookup()
If name argument is empty, e.g. an icon is created by
QIcon::fromTheme(""), then icon_name_hash() will access
a byte at index 1, which is outside of the string.
Change-Id: I109c476718939d7dd252007ebac48c3dbbeceb72
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
bb10
parent
dbfa374a86
commit
98c5f22161
|
|
@ -281,7 +281,7 @@ static quint32 icon_name_hash(const char *p)
|
|||
QVector<const char *> QIconCacheGtkReader::lookup(const QStringRef &name)
|
||||
{
|
||||
QVector<const char *> ret;
|
||||
if (!isValid())
|
||||
if (!isValid() || name.isEmpty())
|
||||
return ret;
|
||||
|
||||
QByteArray nameUtf8 = name.toUtf8();
|
||||
|
|
|
|||
Loading…
Reference in New Issue