Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fa54ce7 authored by that's avatar that
Browse files

gui: fix potential invalid memory access

A single char should never be treated as a string.

Change-Id: I5f8459495f7d0f907ac7c0ae6dd73a3428d92d23
parent f37aec20
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -714,11 +714,7 @@ int GUIInput::NotifyKeyboard(int key)
			if (mCursorLocation == -1) {
				variableValue += key;
			} else {
				const char newchar = (char)key;
				const char* a = &newchar;
				string newstring = a;
				newstring.resize(1);
				variableValue.insert(mCursorLocation + skipChars, newstring);
				variableValue.insert(mCursorLocation + skipChars, 1, key);
				mCursorLocation++;
			}
			isLocalChange = true;