diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2023-10-02 06:56:56 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-04 18:37:22 +0000 |
commit | cfce2856001464b1a8a7a9ce4c2c8e4fb79af647 (patch) | |
tree | a74476228bd974bce1520ae2edf505b796208f08 | |
parent | f69bc2faa4e7d8825c2156a5d469a101c8525531 (diff) |
AspectCommandDebugger::trim: use memmove instead of memcpy
Since the ranges to copy overlap, memcpy isn't safe to use, memmove is.
Task-number: QTBUG-117065
Change-Id: Ib4197f35c919b24ce229def0f5e154221d22357f
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit 6a407b6e9bb24a87e7ff9434fea602029fd5ca67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4f1551ab67159d86309b1947e9ba7365192fb369)
-rw-r--r-- | src/core/aspects/aspectcommanddebugger.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/aspects/aspectcommanddebugger.cpp b/src/core/aspects/aspectcommanddebugger.cpp index d2d19d011..3e787160b 100644 --- a/src/core/aspects/aspectcommanddebugger.cpp +++ b/src/core/aspects/aspectcommanddebugger.cpp @@ -37,9 +37,9 @@ void AspectCommandDebugger::ReadBuffer::insert(const QByteArray &array) void AspectCommandDebugger::ReadBuffer::trim() { if (startIdx != endIdx && startIdx != 0) { - memcpy(buffer.data(), - buffer.constData() + startIdx, - size()); + memmove(buffer.data(), + buffer.constData() + startIdx, + size()); endIdx -= startIdx; startIdx = 0; } |