[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)
authorZhang Yu <zhangyub@uniontech.com>
Mon, 22 Feb 2021 01:25:01 +0000 (09:25 +0800)
committerRaspbian forward porter <root@raspbian.org>
Tue, 24 Aug 2021 13:28:22 +0000 (14:28 +0100)
commit6b84469c1b88f3b79986468488de3de58ffb3c43
treeab05c51e8fdf78091048c25683591edc33cb18e5
parent9d2d9c8da4e8636905b95428778acc49fcd63c2a
[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)

QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Gbp-Pq: Name fix-invalid-pointer-return-with-QGridLayout.diff
src/widgets/kernel/qgridlayout.cpp
tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp