diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 23:33:03 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 23:33:03 +0200 |
commit | 3144d1b4bbf523b80fa04ba61787d9366ccc0443 (patch) | |
tree | b22aabcd878cecb59615ee737532b0216efb3d2c | |
parent | 4f393198d022815c66b10871c7e5efe45a0bf462 (diff) | |
download | sink-3144d1b4bbf523b80fa04ba61787d9366ccc0443.tar.gz sink-3144d1b4bbf523b80fa04ba61787d9366ccc0443.zip |
Do a safe copy by passing in the size
-rw-r--r-- | common/domain/applicationdomaintype.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index ad2d7a1..29bebcf 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -74,7 +74,7 @@ public: | |||
74 | //TODO only copy requested properties | 74 | //TODO only copy requested properties |
75 | auto memoryAdaptor = QSharedPointer<Akonadi2::ApplicationDomain::MemoryBufferAdaptor>::create(*(domainType.mAdaptor)); | 75 | auto memoryAdaptor = QSharedPointer<Akonadi2::ApplicationDomain::MemoryBufferAdaptor>::create(*(domainType.mAdaptor)); |
76 | //The identifier still internal refers to the memory-mapped pointer, we need to copy the memory or it will become invalid | 76 | //The identifier still internal refers to the memory-mapped pointer, we need to copy the memory or it will become invalid |
77 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData()), domainType.mRevision, memoryAdaptor); | 77 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); |
78 | } | 78 | } |
79 | 79 | ||
80 | virtual ~ApplicationDomainType() {} | 80 | virtual ~ApplicationDomainType() {} |