summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-02-21 15:05:09 +0100
committerAndy Shaw <andy.shaw@qt.io>2020-02-25 18:58:17 +0100
commitce55667b62e77902c18d9a2a62e5e323516159d7 (patch)
tree06b599f36389ddbc01686f007083123d26938c9e /src
parent34a67b36528ce4f371ca972fb1fdb666da807f01 (diff)
Set the size of the buffer so it is big enough to hold the contents
This will prevent a crash later on when it tries to assign to an index in a QString that has not been allocated. Fixes: QTBUG-81950 Change-Id: Ia0b5648a18f15594eeca07d234bedadcfeb266ac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index 282714843c..8ac7040ea7 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -713,7 +713,7 @@ void QLCDNumber::paintEvent(QPaintEvent *)
void QLCDNumberPrivate::internalSetString(const QString& s)
{
Q_Q(QLCDNumber);
- QString buffer;
+ QString buffer(ndigits, QChar());
int i;
int len = s.length();
QBitArray newPoints(ndigits);