jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=e2fbca3297dfddcb5d0aef2a23007da3593ac6a5

commit e2fbca3297dfddcb5d0aef2a23007da3593ac6a5
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Fri Jun 12 10:56:22 2015 +0300

    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
---
 src/lib/elm_cnp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 2916a6f..d2bd5e0 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -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);

-- 


Reply via email to