diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 7520ae2085c..1fc8797374e 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -2551,7 +2551,7 @@ QByteArray &QByteArray::replace(QByteArrayView before, QByteArrayView after) } else { to = index; } - if (asize) { + if (asize > 0) { memcpy(d + to, a, asize); to += asize; }