Changeset 220525 in webkit
- Timestamp:
- Aug 10, 2017 4:02:33 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220523 r220525 1 2017-08-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable 4 https://bugs.webkit.org/show_bug.cgi?id=174161 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the 9 data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value 10 less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to 11 return early only when data lenght is less than 0 and handle the 0 length case in each target. 12 13 * platform/gtk/PasteboardHelper.cpp: 14 (WebCore::PasteboardHelper::fillSelectionData): 15 1 16 2017-08-10 Antti Koivisto <antti@apple.com> 2 17 -
trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp
r219385 r220525 210 210 void PasteboardHelper::fillSelectionData(GtkSelectionData* data, unsigned /* info */, SelectionData& selection) 211 211 { 212 if ( !gtk_selection_data_get_length(data))212 if (gtk_selection_data_get_length(data) < 0) 213 213 return; 214 214 … … 229 229 // Give preference to text/uri-list here, as it can hold more 230 230 // than one URI but still take the label if there is one. 231 if (!selection.hasURIList() )231 if (!selection.hasURIList() && !pieces.isEmpty()) 232 232 selection.setURIList(pieces[0]); 233 233 if (pieces.size() > 1) 234 234 selection.setText(pieces[1]); 235 } else if (target == unknownAtom ) {235 } else if (target == unknownAtom && gtk_selection_data_get_length(data)) { 236 236 GRefPtr<GVariant> variant = g_variant_new_parsed(reinterpret_cast<const char*>(gtk_selection_data_get_data(data))); 237 237
Note: See TracChangeset
for help on using the changeset viewer.