Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.0.0 Beta4
-
Ubuntu 20.04 LTS 64 bit
clang 10.0.0
Built with qmake
-
638171eb10cfb186a6c47ec052a3b0c5b6449386 (qt/qtbase/dev) c5623e5bb13824ef7d735e8d429278223b2887c1 (qt/qtbase/6.0)
Description
- Build the attached project.
- Run it on the attached input:
./report input.cbor
- Watch the value of "newSize" in line 1583 of qcborvalue.cpp:
data.resize(newSize);
Use a breakpoint, a qDebug() or whatever you prefer.
It will try resizing the QByteArray to 2147483639.
Allocating 2 GiB of memory doesn't seem appropriate for 8 bytes of input.
This is a regression from Qt 5.15. There, the function will return -1 before:
if (newSize > MaxByteArraySize) return -1;
Attachments
Issue Links
- relates to
-
QTBUG-88253 [REG 5.15 -> 6.0] QCborStreamReader allocates 2 GiB for 8 B file
- Closed