Fix access to invalid memory

QString::toLatin1() creates a temporary QByteArray.

Task-number: QTBUG-30578
Change-Id: I17c60bbade1486399f745c7e9878c6467971e6cc
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
bb10
Kai Koehne 2013-04-09 13:03:57 +02:00 committed by The Qt Project
parent 6617b6765a
commit 0eefbf8376
1 changed files with 2 additions and 1 deletions

View File

@ -287,7 +287,8 @@ ushort TableGenerator::keysymToUtf8(uint32_t sym)
uint32_t TableGenerator::stringToKeysym(QString keysymName)
{
uint32_t keysym;
const char *name = keysymName.toLatin1().constData();
QByteArray keysymArray = keysymName.toLatin1();
const char *name = keysymArray.constData();
if ((keysym = xkb_keysym_from_name(name, (xkb_keysym_flags)0)) == XKB_KEY_NoSymbol)
qWarning() << QString("Qt Warrning - invalid keysym: %1").arg(keysymName);