From: Ivailo Monev Date: Thu, 14 Jan 2021 05:54:27 +0000 (+0200) Subject: correct copying of QByteArrayMatcher and QStringMatcher skip tables X-Git-Tag: 4.12.0~2753 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=804b798a912580e142ddeb7d8f9276432554a084;p=kde%2FKatie.git correct copying of QByteArrayMatcher and QStringMatcher skip tables Signed-off-by: Ivailo Monev --- 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; }