Skip to content

Commit dfe51aa

Browse files
Lauris Kaplinskimrts
authored andcommitted
Use QString::fill instead of eraseData to force copy-on-write
1 parent 751c841 commit dfe51aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ui/webeiddialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ QString WebEidDialog::getPin()
292292
// QString uses QAtomicPointer internally and is thread-safe.
293293
// There should be only single reference and this is transferred to the caller for safety
294294
QString ret = pin;
295-
eraseData(pin);
296-
pin.clear();
295+
// Cannot use eraseData because we have to force Qt copy-on-write
296+
pin.fill('\0');
297+
pin.clear();
297298
return ret;
298299
}
299300

0 commit comments

Comments
 (0)