REGRESSION (r107568-r107627): Crash when copying in WebCore::SharedBuffer::hasPlatfor...
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 00:35:51 +0000 (00:35 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 00:35:51 +0000 (00:35 +0000)
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
Source/WebCore/platform/mac/PlatformPasteboardMac.mm

index 60ed444..9386c03 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-14  Enrica Casucci  <enrica@apple.com>
+
+        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  <rniwa@webkit.org>
 
         Crash in WebCore::SVGElement::removedFromDocument
index 5968874..059e435 100644 (file)
@@ -87,7 +87,7 @@ void PlatformPasteboard::setTypes(const Vector<String>& pasteboardTypes)
 
 void PlatformPasteboard::setBufferForType(PassRefPtr<SharedBuffer> 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<String>& pathnames, const String& pasteboardType)