evas: Fix wrong access issue 44/88744/3
authorjiin.moon <jiin.moon@samsung.com>
Tue, 20 Sep 2016 11:27:25 +0000 (20:27 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 21 Sep 2016 02:25:06 +0000 (19:25 -0700)
If bidi_props is NULL, do not access this point.

@tizen_fix

Change-Id: I8ded9b3c5baec1be2c9ce1a9feb28f780fee41df

src/lib/evas/common/language/evas_bidi_utils.c

index f04c825..6d28ee6 100644 (file)
@@ -257,6 +257,11 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len,
 #endif
 
    bidi_props = evas_bidi_paragraph_props_new();
+   if (!bidi_props) /* TIZEN ONLY(20160920): In review on upstrem */
+     {
+         len = -2;
+         goto cleanup;
+     }
    bidi_props->direction = base_bidi;
 
    /* Prep work for reordering */
@@ -562,6 +567,9 @@ evas_bidi_paragraph_props_new(void)
 {
    Evas_BiDi_Paragraph_Props *ret;
    ret = calloc(1, sizeof(Evas_BiDi_Paragraph_Props));
+   /* TIZEN ONLY(20160920): In review on upstrem */
+   if (!ret) return NULL;
+
    ret->direction = EVAS_BIDI_PARAGRAPH_NEUTRAL;
    ret->refcount = 1;