From 0e15915b8f5c4b460afc2b16b8a1f8b5e92e3821 Mon Sep 17 00:00:00 2001 From: "enrica@apple.com" Date: Wed, 15 Feb 2012 00:35:51 +0000 Subject: [PATCH] REGRESSION (r107568-r107627): Crash when copying in WebCore::SharedBuffer::hasPlatformData(). https://bugs.webkit.org/show_bug.cgi?id=78577 Reviewed by Dan Bernstein. * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::setBufferForType): Missing null check when setting data to the NSPasteboard. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107753 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 11 +++++++++++ Source/WebCore/platform/mac/PlatformPasteboardMac.mm | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 60ed444..9386c03 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2012-02-14 Enrica Casucci + + REGRESSION (r107568-r107627): Crash when copying in WebCore::SharedBuffer::hasPlatformData(). + https://bugs.webkit.org/show_bug.cgi?id=78577 + + Reviewed by Dan Bernstein. + + * platform/mac/PlatformPasteboardMac.mm: + (WebCore::PlatformPasteboard::setBufferForType): Missing null check when + setting data to the NSPasteboard. + 2012-02-14 Ryosuke Niwa Crash in WebCore::SVGElement::removedFromDocument diff --git a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm index 5968874..059e435 100644 --- a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm +++ b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm @@ -87,7 +87,7 @@ void PlatformPasteboard::setTypes(const Vector& pasteboardTypes) void PlatformPasteboard::setBufferForType(PassRefPtr buffer, const String& pasteboardType) { - [m_pasteboard.get() setData:[buffer->createNSData() autorelease] forType:pasteboardType]; + [m_pasteboard.get() setData:buffer ? [buffer->createNSData() autorelease] : nil forType:pasteboardType]; } void PlatformPasteboard::setPathnamesForType(const Vector& pathnames, const String& pasteboardType) -- 2.7.4