From 804b798a912580e142ddeb7d8f9276432554a084 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 14 Jan 2021 07:54:27 +0200 Subject: [PATCH] correct copying of QByteArrayMatcher and QStringMatcher skip tables Signed-off-by: Ivailo Monev --- src/core/tools/qbytearraymatcher.cpp | 2 +- src/core/tools/qstringmatcher.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/tools/qbytearraymatcher.cpp b/src/core/tools/qbytearraymatcher.cpp index e428f9915..b03ef851c 100644 --- a/src/core/tools/qbytearraymatcher.cpp +++ b/src/core/tools/qbytearraymatcher.cpp @@ -156,7 +156,7 @@ QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other) { if (this != &other) { q_pattern = other.q_pattern; - ::memcpy(&q_skiptable, &other.q_skiptable, sizeof(q_skiptable)); + ::memcpy(&q_skiptable, &other.q_skiptable, sizeof(q_skiptable) * sizeof(uchar)); } return *this; } diff --git a/src/core/tools/qstringmatcher.cpp b/src/core/tools/qstringmatcher.cpp index cde671e71..9d754e7c0 100644 --- a/src/core/tools/qstringmatcher.cpp +++ b/src/core/tools/qstringmatcher.cpp @@ -195,7 +195,7 @@ QStringMatcher &QStringMatcher::operator=(const QStringMatcher &other) if (this != &other) { q_pattern = other.q_pattern; q_cs = other.q_cs; - ::memcpy(&q_skiptable, &other.q_skiptable, sizeof(q_skiptable)); + ::memcpy(&q_skiptable, &other.q_skiptable, sizeof(q_skiptable) * sizeof(uchar)); } return *this; } -- 2.11.0