summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-12 20:18:15 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-12 20:18:15 +0000
commit2e69444f7ffe44fd951ead1f8da6de45414c4489 (patch)
tree786c31f5d1505df4c178d932ed9c39f77f03ea1e /webkit
parent054af14a81b265b02eff3db0fb7fa072581720e6 (diff)
downloadchromium_src-2e69444f7ffe44fd951ead1f8da6de45414c4489.zip
chromium_src-2e69444f7ffe44fd951ead1f8da6de45414c4489.tar.gz
chromium_src-2e69444f7ffe44fd951ead1f8da6de45414c4489.tar.bz2
Fixes possible crash in copying url to clipboard. I believe the crash
is happening because the title's string implementation is null. If the title's string implementation is null then charactersWithNullTermination will return null and we'll crash as in the stack trace. BUG=1374632 TEST=none Review URL: http://codereview.chromium.org/2812 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/platform/ClipboardUtilitiesWin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/webkit/port/platform/ClipboardUtilitiesWin.cpp b/webkit/port/platform/ClipboardUtilitiesWin.cpp
index f5223df..a35794f 100644
--- a/webkit/port/platform/ClipboardUtilitiesWin.cpp
+++ b/webkit/port/platform/ClipboardUtilitiesWin.cpp
@@ -50,7 +50,7 @@ HGLOBAL createGlobalData(const KURL& url, const String& title)
if (cbData) {
PWSTR buffer = (PWSTR)::GlobalLock(cbData);
- swprintf_s(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.charactersWithNullTermination());
+ swprintf_s(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination(), mutableTitle.isNull() ? L"" : mutableTitle.charactersWithNullTermination());
::GlobalUnlock(cbData);
}
return cbData;