cnp: Add safety check for NULL pointer from _elm_util_text_to_mkup().

Summary:
_elm_util_text_to_mkup() func could return NULL when malloc is failed internally.
CID - 398441
@fix

Reviewers: raster, thiepha, woohyun, Hermet

Differential Revision: https://phab.enlightenment.org/D2668
This commit is contained in:
Youngbok Shin 2015-06-12 10:56:22 +03:00 committed by Daniel Zaoui
parent bda0ccfb60
commit e227bad7fe
1 changed files with 8 additions and 0 deletions

View File

@ -996,6 +996,14 @@ _x11_notify_handler_text(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify
cnp_debug("Notify handler text %d %d %p\n", data->format,
data->length, data->data);
mkupstr = _elm_util_text_to_mkup((const char *)stripstr);
if (!mkupstr)
{
ERR("Failed to convert text to markup text!");
free(stripstr);
goto end;
}
cnp_debug("String is %s (from %s)\n", stripstr, data->data);
/* TODO BUG: should never NEVER assume it's an elm_entry! */
_elm_entry_entry_paste(sel->requestwidget, mkupstr);