diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-13 03:55:55 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-13 03:55:55 (GMT) |
commit | 2c36d7c63fc88b1f06582884fd3ea0b26534a2cd (patch) | |
tree | 8f61511b7f81dbac532e60cd4d9cde721972395a /src | |
parent | 6e85ca2a9b18f04fd39df9b66ab9869a7d9b11ac (diff) | |
download | Qt-2c36d7c63fc88b1f06582884fd3ea0b26534a2cd.zip Qt-2c36d7c63fc88b1f06582884fd3ea0b26534a2cd.tar.gz Qt-2c36d7c63fc88b1f06582884fd3ea0b26534a2cd.tar.bz2 |
Don't pass a pointer to invalid memory
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qmltypenamescriptclass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/qml/qmltypenamescriptclass.cpp b/src/declarative/qml/qmltypenamescriptclass.cpp index c0613d1..7a14432 100644 --- a/src/declarative/qml/qmltypenamescriptclass.cpp +++ b/src/declarative/qml/qmltypenamescriptclass.cpp @@ -115,11 +115,11 @@ QmlTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name, // Must be an enum if (data->mode == IncludeEnums) { // ### Optimize - const char *enumName = strName.toUtf8().constData(); + QByteArray enumName = strName.toUtf8(); const QMetaObject *metaObject = data->type->baseMetaObject(); for (int ii = metaObject->enumeratorCount() - 1; ii >= 0; --ii) { QMetaEnum e = metaObject->enumerator(ii); - int value = e.keyToValue(enumName); + int value = e.keyToValue(enumName.constData()); if (value != -1) { enumValue = value; return QScriptClass::HandlesReadAccess; |