forked from enlightenment/efl
ecore_x: Check if we have data
data could be NULL and size == 0, so check for this. Fixes CID 1039264
This commit is contained in:
parent
04e0a6d95e
commit
f22f861f61
|
@ -760,10 +760,7 @@ _ecore_x_selection_parser_files(const char *target,
|
|||
int format EINA_UNUSED)
|
||||
{
|
||||
Ecore_X_Selection_Data_Files *sel;
|
||||
char *t, *data = _data;
|
||||
int i, is;
|
||||
char *tmp;
|
||||
char **t2;
|
||||
char *data = _data;
|
||||
|
||||
if (strcmp(target, "text/uri-list") &&
|
||||
strcmp(target, "_NETSCAPE_URL"))
|
||||
|
@ -773,8 +770,16 @@ _ecore_x_selection_parser_files(const char *target,
|
|||
if (!sel) return NULL;
|
||||
ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_files_free;
|
||||
|
||||
if (data && data[size - 1])
|
||||
if (data && (size > 0))
|
||||
{
|
||||
int i, is;
|
||||
char *tmp;
|
||||
char **t2;
|
||||
|
||||
if (data[size - 1])
|
||||
{
|
||||
char *t;
|
||||
|
||||
/* Isn't nul terminated */
|
||||
size++;
|
||||
t = realloc(data, size);
|
||||
|
@ -834,6 +839,7 @@ _ecore_x_selection_parser_files(const char *target,
|
|||
}
|
||||
|
||||
free(tmp);
|
||||
}
|
||||
free(data);
|
||||
|
||||
ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_FILES;
|
||||
|
|
Loading…
Reference in New Issue