| Index: webkit/tools/test_shell/test_shell_win.cc
|
| ===================================================================
|
| --- webkit/tools/test_shell/test_shell_win.cc (revision 7582)
|
| +++ webkit/tools/test_shell/test_shell_win.cc (working copy)
|
| @@ -650,11 +650,13 @@
|
| switch (message) {
|
| case WM_CHAR:
|
| if (wParam == VK_RETURN) {
|
| - wchar_t strPtr[MAX_URL_LENGTH];
|
| + wchar_t strPtr[MAX_URL_LENGTH + 1]; // Leave room for adding a NULL;
|
| *((LPWORD)strPtr) = MAX_URL_LENGTH;
|
| LRESULT strLen = SendMessage(hwnd, EM_GETLINE, 0, (LPARAM)strPtr);
|
| - if (strLen > 0)
|
| + if (strLen > 0) {
|
| + strPtr[strLen] = 0; // EM_GETLINE doesn't NULL terminate.
|
| shell->LoadURL(strPtr);
|
| + }
|
|
|
| return 0;
|
| }
|
|
|