cnp: Add safety check for NULL pointer from malloc().
Summary: It could make crash when malloc is failed. @fix Reviewers: raster, woohyun, Hermet, JackDanielZ, thiepha Subscribers: JackDanielZ Differential Revision: https://phab.enlightenment.org/D2671
This commit is contained in:
parent
d04e6c7d6a
commit
6f33f4f1d1
|
@ -1024,6 +1024,8 @@ _x11_data_preparer_uri(Ecore_X_Event_Selection_Notify *notify,
|
||||||
else
|
else
|
||||||
p = files->files[i];
|
p = files->files[i];
|
||||||
|
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
len = strlen(p);
|
len = strlen(p);
|
||||||
strcpy(s, p);
|
strcpy(s, p);
|
||||||
if (i < (files->num_files - 1))
|
if (i < (files->num_files - 1))
|
||||||
|
@ -1037,6 +1039,7 @@ _x11_data_preparer_uri(Ecore_X_Event_Selection_Notify *notify,
|
||||||
s[len] = 0;
|
s[len] = 0;
|
||||||
s += len;
|
s += len;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (uri[i])
|
if (uri[i])
|
||||||
efreet_uri_free(uri[i]);
|
efreet_uri_free(uri[i]);
|
||||||
|
|
Loading…
Reference in New Issue