summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-08 01:00:59 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-08 01:01:00 +0100
commitf8c5c1356465f503e1a8357ceff01bb956d51c9e (patch)
tree36b5bc1c2d5767b3eee0820c70b91fdfc57287b3 /src/widgets/widgets
parenteda28621f6c1a68774719f382be53ec109123b18 (diff)
parent153726bc167406414f589f72bea76c3229cfa815 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index b730b415f0..f4df95865d 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -280,6 +280,13 @@ public:
cancelPasswordEchoTimer();
m_echoMode = mode;
m_passwordEchoEditing = false;
+
+ // If this control is used for password input, we want to minimize
+ // the possibility of string reallocation not to leak (parts of)
+ // the password.
+ if (m_echoMode != QLineEdit::Normal)
+ m_text.reserve(30);
+
updateDisplayText();
}