Don't overwrite memory when pressing return in the URL text input.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@405 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi
2012-07-03 15:40:17 +02:00
committed by Alexandre Deckner
parent 3aa3e03460
commit 560610f70e
+2 -2
View File
@@ -320,10 +320,10 @@ URLInputGroup::URLTextView::InsertText(const char* inText, int32 inLength,
char* buffer = NULL;
if (strpbrk(inText, "\r\n") && inLength <= 1024) {
buffer = (char*)malloc(inLength);
buffer = (char*)malloc(inLength + 1);
if (buffer) {
strcpy(buffer, inText);
strlcpy(buffer, inText, inLength);
for (int32 i = 0; i < inLength; i++) {
if (buffer[i] == '\r' || buffer[i] == '\n')