mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Protect against a copy of zero characters (zero-length buffer)
This commit is contained in:
parent
75422fa57c
commit
7697fc19e2
@ -237,8 +237,10 @@ void nsSelectionMgr::SelectionRequestor( GtkWidget *widget,
|
||||
guchar* str = (guchar*)(mCopyStream->str());
|
||||
|
||||
// Currently we only offer the data in XA_STRING format.
|
||||
gtk_selection_data_set(selection_data, XA_STRING,
|
||||
8, str, strlen((char*)str));
|
||||
if(str) {
|
||||
gtk_selection_data_set(selection_data, XA_STRING,
|
||||
8, str, strlen((char*)str));
|
||||
}
|
||||
// the format arg, "8", indicates string data with no endianness
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user