From 7f921924f56f3beb569fd1d8c2f233fbb7f895ea Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jun 2012 19:10:43 +0100 Subject: [PATCH] Use a heap allocation when hiding password text --- src/interface/Textbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/interface/Textbox.cpp b/src/interface/Textbox.cpp index 9db4dc650..4c0e267bf 100644 --- a/src/interface/Textbox.cpp +++ b/src/interface/Textbox.cpp @@ -129,10 +129,11 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool { if(masked) { - char tempText[text.length()]; - memset(tempText, 0x8d, text.length()); + char * tempText = new char[text.length()]; + std::fill(tempText, tempText+text.length(), 0x8d); tempText[text.length()] = 0; displayText = tempText; + delete tempText; } else {