Bug 1225829 - Use a temporary string to avoid string type confusion via references. r=jimm a=ritu
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 10 Dec 2015 15:31:17 -0500
changeset 292366 bac789f5d52ceaa186fffdc2116dac424be4d51a
parent 292365 b7c348a34b3d33c7c8c6d07df9dc23707047d47f
child 292367 9d310a41f8c220b00b0b781a88f6abe974a3eca2
push id227
push usercbook@mozilla.com
push dateWed, 30 Dec 2015 14:49:35 +0000
reviewersjimm, ritu
bugs1225829
milestone44.0
Bug 1225829 - Use a temporary string to avoid string type confusion via references. r=jimm a=ritu
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7515,17 +7515,19 @@ nsContentUtils::TransferableToIPCTransfe
             // constructor before processing our response, which would crash. In
             // that case, hope that the caller is nsClipboardProxy::GetData,
             // called from editor and send over images as raw data.
             if (aInSyncMessage) {
               nsAutoCString type;
               if (IsFileImage(file, type)) {
                 IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
                 item->flavor() = type;
-                SlurpFileToString(file, item->data());
+                nsAutoCString data;
+                SlurpFileToString(file, data);
+                item->data() = data;
               }
 
               continue;
             }
 
             blobImpl = new BlobImplFile(file, false);
             ErrorResult rv;
             // Ensure that file data is cached no that the content process