OSDN Git Service

correct copying of QByteArrayMatcher and QStringMatcher skip tables
authorIvailo Monev <xakepa10@gmail.com>
Thu, 14 Jan 2021 05:54:27 +0000 (07:54 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Thu, 14 Jan 2021 05:54:27 +0000 (07:54 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qbytearraymatcher.cpp
src/core/tools/qstringmatcher.cpp

index e428f99..b03ef85 100644 (file)
@@ -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;
 }
index cde671e..9d754e7 100644 (file)
@@ -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;
 }