From 7645c8e0f88a83d021f0a327617189b7772b14eb Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 20 May 2020 15:54:14 +0200 Subject: Don't return a pointer to a local in QObjectWrapper::getQmlProperty() findProperty() can optionally create the property on the fly. We store the result on the stack. In that case we can figure out that the property exists, but we cannot return its value. This is OK, as we do the same in the default case below. Coverity-Id: 193545 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I3a87fc6f577807e2daf74eeacd2aab61f40aefc8 Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 4366a6932d..fd8a0bed5d 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -392,7 +392,7 @@ ReturnedValue QObjectWrapper::getQmlProperty( if (hasProperty) *hasProperty = true; - if (property) + if (property && result != &local) *property = result; return getProperty(engine, object, result); -- cgit v1.2.3