elementary/elm_entry : Fixed a bug. While appending big sized string,
authorwoohyun <woohyun@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Apr 2012 00:50:56 +0000 (00:50 +0000)
committerwoohyun <woohyun@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 2 Apr 2012 00:50:56 +0000 (00:50 +0000)
elm_entry_entry_get caused segfault because memcpy could be tried with
NULL pointer + "> 0" length.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69829 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_entry.c

index 64724db..740c8db 100644 (file)
@@ -2349,7 +2349,8 @@ _elm_entry_text_get(const Evas_Object *obj, const char *item)
              return NULL;
           }
         memcpy(tmpbuf, text, tlen);
-        memcpy(tmpbuf + tlen, wd->append_text_left, wd->append_text_len);
+        if (wd->append_text_left)
+          memcpy(tmpbuf + tlen, wd->append_text_left, strlen(wd->append_text_len));
         tmpbuf[tlen + wd->append_text_len] = '\0';
         eina_stringshare_replace(&wd->text, tmpbuf);
         free(tmpbuf);