billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=b66dc2a3a0c4fb09ef04283ab539f0432db1663d

commit b66dc2a3a0c4fb09ef04283ab539f0432db1663d
Author: Boris Faure <bill...@gmail.com>
Date:   Mon Oct 14 23:32:48 2013 +0200

    fix CID 1100641 - uninitialized scalar variable
---
 src/bin/termio.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 50f49e4..71c5123 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1688,7 +1688,7 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
    Termio *sd = evas_object_smart_data_get(obj);
    int start_x = 0, start_y = 0, end_x = 0, end_y = 0;
    char *s = NULL;
-   size_t len;
+   size_t len = 0;
 
    if (!sd) return;
    if (sd->cur.sel)
@@ -1725,7 +1725,10 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
         eina_strbuf_free(sb);
      }
    else if (!start_y && !end_y && !start_x && !end_x && sd->link.string)
-     s = strdup(sd->link.string);
+     {
+        len = strlen(sd->link.string);
+        s = strndup(sd->link.string, len);
+     }
    else if ((start_x != end_x) || (start_y != end_y))
      {
         if ((start_y > end_y) || ((start_y == end_y) && (end_x < start_x)))
@@ -1738,7 +1741,7 @@ _take_selection(Evas_Object *obj, Elm_Sel_Type type)
 
    if (s)
      {
-        if (sd->win)
+        if ((sd->win) && (len > 0))
           {
              sd->have_sel = EINA_FALSE;
              sd->reset_sel = EINA_FALSE;

-- 


Reply via email to