From 5b64da01a381aca6890490fc92ef704f4342eb7e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Jul 2015 18:01:05 +0200 Subject: Copy the identifier as well. Otherwise the value could silently start to point to invalid memory. --- common/domain/applicationdomaintype.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/domain/applicationdomaintype.h') diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index a581068..ad2d7a1 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -73,7 +73,8 @@ public: { //TODO only copy requested properties auto memoryAdaptor = QSharedPointer::create(*(domainType.mAdaptor)); - return QSharedPointer::create(domainType.mResourceInstanceIdentifier, domainType.mIdentifier, domainType.mRevision, memoryAdaptor); + //The identifier still internal refers to the memory-mapped pointer, we need to copy the memory or it will become invalid + return QSharedPointer::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData()), domainType.mRevision, memoryAdaptor); } virtual ~ApplicationDomainType() {} -- cgit v1.2.3