Package: qtbase-opensource-src / 5.15.2+dfsg-9+deb11u1

qiodevice_readline_memory.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: fix allocated memory of QByteArray returned by QIODevice::readLine
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=6485b6d45ad165cf
Last-Update: 2021-02-20

--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1480,10 +1480,12 @@ QByteArray QIODevice::readLine(qint64 ma
     } else
         readBytes = readLine(result.data(), result.size());
 
-    if (readBytes <= 0)
+    if (readBytes <= 0) {
         result.clear();
-    else
+    } else {
         result.resize(readBytes);
+        result.squeeze();
+    }
 
     return result;
 }