elm cnp - check if selbuf is null or not and skip copying if null

this should fix CID 1377536
This commit is contained in:
Carsten Haitzler 2017-07-23 18:56:43 +09:00
parent b3b0411a05
commit b2809026bb
1 changed files with 1 additions and 1 deletions

View File

@ -4431,7 +4431,7 @@ _local_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED,
free(_local_selinfo[selection].sel.buf);
_local_selinfo[selection].format = format;
_local_selinfo[selection].sel.buf = malloc(buflen + 1);
if (_local_selinfo[selection].sel.buf)
if ((_local_selinfo[selection].sel.buf) && (selbuf))
{
memcpy(_local_selinfo[selection].sel.buf, selbuf, buflen);
_local_selinfo[selection].sel.buf[buflen] = 0;