From 817e47fbcde21ab54d353efd647685159cb437a9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 17 Aug 2022 13:19:10 +0200 Subject: QBuffer: fix the setData() API re: int/qsizetype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The setData(ptr, n) overload was still taking the size as int. Widen it. Task-number: QTBUG-103525 Change-Id: If1d6d6404d62bbae5e0defea9a2115648c1fd5da Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Sona Kurazyan --- src/corelib/io/qbuffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qbuffer.cpp') diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp index c244dacab3d..0dcc02459da 100644 --- a/src/corelib/io/qbuffer.cpp +++ b/src/corelib/io/qbuffer.cpp @@ -267,12 +267,15 @@ void QBuffer::setData(const QByteArray &data) } /*! - \fn void QBuffer::setData(const char *data, int size) + \fn void QBuffer::setData(const char *data, qsizetype size) \overload Sets the contents of the internal buffer to be the first \a size bytes of \a data. + + \note In Qt versions prior to 6.5, this function took the length as + an \c{int} parameter, potentially truncating sizes. */ /*! -- cgit v1.2.3