qt5base-lts/tests/auto/corelib/serialization
Thiago Macieira 02d595946f QCborValue::fromCbor: Apply a recursion limit to decoding
A simple 16k file can produce deep enough recursion in Qt to cause stack
overflow. So prevent that.

I tested 4096 recursions just fine on my Linux system (8 MB stack), but
decided 1024 was sufficient, as this code will also be run on embedded
systems that could have smaller stacks.

[ChangeLog][QtCore][QCborValue] fromCbor() now limits decoding to at
most 1024 nested maps, arrays, and tags to prevent stack overflows. This
should be sufficient for most uses of CBOR. An API to limit further or
to relax the limit will be provided in 5.15. Meanwhile, if decoding more
is required, QCborStreamReader can be used (note that each level of map
and array allocates memory).

Change-Id: Iaa63461109844e978376fffd15fa0fbefbf607a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-25 16:21:47 -03:00
..
json Fix removal of QJsonObject properties when assigning undefined 2019-07-30 11:08:24 +02:00
qcborstreamreader Fix QCborStreamReader not flushing QIODevices due to internal buffering 2019-07-19 12:31:42 -07:00
qcborstreamwriter Long live QCborStreamWriter! 2018-05-27 22:41:41 +00:00
qcborvalue QCborValue::fromCbor: Apply a recursion limit to decoding 2020-03-25 16:21:47 -03:00
qcborvalue_json QCborValue: move the toDiagnosticNotation() function to its own file 2018-07-30 16:21:12 +00:00
qdatastream Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
qdatastream_core_pixmap Tidy up data-stream test 2019-10-25 11:44:13 +02:00
qtextstream Update for failures only on dev branch. Use general platform names 2019-08-19 18:22:11 +02:00
qxmlstream QXmlStreamReader: early return in case of malformed attributes 2020-01-23 19:44:09 +01:00
serialization.pro Exclude tests that need GUI when GUI isn't available 2019-10-25 11:42:09 +02:00