From faa854ffeb1e028c401b449f1b18ee3ae92263e0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 3 Nov 2021 16:04:31 +0100 Subject: QByteArrayList: fix narrowing in join() implementations [2/2] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We forgot to adjust the interface and implementation of join() to the int → qsizetype change in Qt 6. This part of the two-part patch fixes things in a non-forwards-BC way, so it can't be picked into released versions. The forwards-BC part is in the first patch of the series. We can't just replace the int seplen with qsizetype, because qsizetype is an alias to int on 32-bit platforms. So, pass the separator by QByteArrayView. [ChangeLog][QtCore][QByteArrayList] Fixed a bug when calling join() with separators of length > INTMAX. Change-Id: I2ccc61de1c8901ac5504aea1ebd895d12dbcb064 Reviewed-by: Mårten Nordheim --- src/corelib/compat/removed_api.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/corelib/compat/removed_api.cpp') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index b2e758d2ca..8d5bfb44a7 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -89,6 +89,13 @@ QUuid QUuid::fromRfc4122(const QByteArray &bytes) return fromRfc4122(qToByteArrayViewIgnoringNull(bytes)); } +#include "qbytearraylist.h" + +QByteArray QtPrivate::QByteArrayList_join(const QByteArrayList *that, const char *sep, int seplen) +{ + return QByteArrayList_join(that, {sep, seplen}); +} + // #include // // implement removed functions from qotherheader.h -- cgit v1.2.3