path: root/src/widgets/widgets/qlcdnumber.cpp
diff options
authorAndy Shaw <>2020-02-21 15:05:09 +0100
committerAndy Shaw <>2020-02-25 18:58:17 +0100
commitce55667b62e77902c18d9a2a62e5e323516159d7 (patch)
tree06b599f36389ddbc01686f007083123d26938c9e /src/widgets/widgets/qlcdnumber.cpp
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 <> Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'src/widgets/widgets/qlcdnumber.cpp')
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)
- QString buffer;
+ QString buffer(ndigits, QChar());
int i;
int len = s.length();
QBitArray newPoints(ndigits);