From f9977c07c19bfe294637ac51b3c64aa237b9a300 Mon Sep 17 00:00:00 2001 From: stippi Date: Mon, 12 Apr 2010 16:16:40 +0000 Subject: [PATCH] strlcpy() takes buffer size, not char count, and will copy buffer size - 1 chars at max and terminate the buffer. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@406 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/URLInputGroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/webpositive/URLInputGroup.cpp b/src/apps/webpositive/URLInputGroup.cpp index 1f69f60538..35a6130181 100644 --- a/src/apps/webpositive/URLInputGroup.cpp +++ b/src/apps/webpositive/URLInputGroup.cpp @@ -323,7 +323,7 @@ URLInputGroup::URLTextView::InsertText(const char* inText, int32 inLength, buffer = (char*)malloc(inLength + 1); if (buffer) { - strlcpy(buffer, inText, inLength); + strlcpy(buffer, inText, inLength + 1); for (int32 i = 0; i < inLength; i++) { if (buffer[i] == '\r' || buffer[i] == '\n')