qt6-bb10/src
Ivan Čukić b91e6befeb Preallocate buffer for QLineEdit when used for password input
While the user is entering the password, the string variable that
stores the value might have to reallocate its content from time
to time (when the string needs to grow beyond its current capacity).

When the reallocation happens, the old buffer is freed, but its
data is not zeroed-out. This means that a QLineEdit that serves as
a password input field might leak chunks of the password during
its lifetime, and the leaks will persist after its destruction.

Since the QLineEdit can not control the behavior of the QString
it uses to store the entered value, the only thing it can do is try
to make the reallocations rare.

This patch reserves the space for 30 characters for the string which
stores the QLineEdit value when said QLineEdit is used for password
input. This is enough to make sure no reallocation happens in
majority of cases as barely anyone uses passwords longer than 30
characters.

[ChangeLog][QtWidgets][QWidgetLineControl/security] Preallocate a buffer
for the string that contains the entered value when the QLineEdit serves
as a password input field to minimize reallocations.

Change-Id: I3e695db93e34c93335c3bf9dbcbac832fc18b62d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-07 15:47:39 +00:00
..
3rdparty ANGLE: Set ANGLE_COMMIT_HASH and ANGLE_COMMIT_DATE 2018-12-07 09:03:19 +00:00
android Add log output if library does not exists 2018-11-21 05:36:31 +00:00
angle Add Windows Desktop arm64 target to Qtbase 2018-11-11 09:05:10 +00:00
concurrent Doc: Fix typo and grammar issues 2018-07-09 17:00:19 +00:00
corelib Fix compilation of qendian's qswap specializations on gcc 4.8 2018-11-29 20:42:33 +00:00
dbus QDBusConnection: prevent leaking connection/server on destroy 2018-11-28 11:19:34 +00:00
gui Set correct vertical position for text following a very large image 2018-12-03 10:42:00 +00:00
network configure: actually resolve libraries into full filepaths 2018-12-03 11:25:56 +00:00
opengl Merge remote-tracking branch 'origin/5.11' into 5.12 2018-11-19 12:42:10 +01:00
openglextensions
platformheaders Fix typos in the documentation 2018-09-25 23:39:06 +00:00
platformsupport Read font selection flags and use them when querying for metrics 2018-11-30 16:15:03 +00:00
plugins macOS: Account for LC_BUILD_VERSION when checking SDK version and deployment target 2018-12-03 22:44:45 +00:00
printsupport Extend PDF engine to allow the generation of PDFs with huge pages 2018-10-22 15:53:17 +00:00
sql QtSql: fix code snippets 2018-10-03 10:48:50 +00:00
testlib Merge remote-tracking branch 'origin/5.11' into 5.12 2018-11-27 01:00:09 +01:00
tools Android: Prepare for the worst, when the NDK will remove all GNU tools 2018-11-19 11:45:20 +00:00
widgets Preallocate buffer for QLineEdit when used for password input 2018-12-07 15:47:39 +00:00
winmain Use msvc qmake scope where appropriate 2018-11-22 14:16:52 +00:00
xml Merge remote-tracking branch 'origin/5.11' into 5.12 2018-11-09 10:34:33 +01:00
src.pro Move androiddeployqt to qtbase 2018-06-21 11:08:57 +00:00