mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1460810 - [Gtk/Wayland] Handle error value (-1) returned by gtk_section_data_get_length(), r=stransky
This commit is contained in:
parent
de265e92c7
commit
b2b1e7e2c3
@ -667,8 +667,9 @@ nsRetrievalContextWayland::TransferFastTrackClipboard(
|
||||
int aClipboardRequestNumber, GtkSelectionData *aSelectionData)
|
||||
{
|
||||
if (mClipboardRequestNumber == aClipboardRequestNumber) {
|
||||
mClipboardDataLength = gtk_selection_data_get_length(aSelectionData);
|
||||
if (mClipboardDataLength > 0) {
|
||||
int dataLength = gtk_selection_data_get_length(aSelectionData);
|
||||
if (dataLength > 0) {
|
||||
mClipboardDataLength = dataLength;
|
||||
mClipboardData = reinterpret_cast<char*>(
|
||||
g_malloc(sizeof(char)*mClipboardDataLength));
|
||||
memcpy(mClipboardData, gtk_selection_data_get_data(aSelectionData),
|
||||
|
Loading…
Reference in New Issue
Block a user