[Interest] QLineEdit - clearing the password from memory

Andreas Pakulat apaku at gmx.de
Wed Apr 4 12:43:34 CEST 2012


On 04.04.12 12:24:15, Marcus Frenkel wrote:
> Hi
> 
> I need to make sure that the password is not kept in memory when
> QLineEdit is destroyed. I tried to use QLineEdit::clear() or
> QLineEdit::setText() but the password string stays in memory. I
> basically want to zeroise the private member string that holds the
> text, I believe QLineEditPrivate::text is the one. How can I access
> this member without changing Qt sources?

You can't access that variable without changing the Qt sources. What you
can do though is to override malloc/free/new/delete with your own
functions which zero-out any memory thats free'd/delete'd and tell Qt to
use your versions of the memory-allocation/de-allocation.

Maybe there's also an existing allocator you could just plugin into your
app that achieves what you want.

Andreas




More information about the Interest mailing list