Entry: Fixed a bug with text appending.
authorTom Hacohen <tom@stosb.com>
Mon, 11 Mar 2013 10:19:29 +0000 (10:19 +0000)
committerTom Hacohen <tom@stosb.com>
Mon, 11 Mar 2013 10:29:30 +0000 (10:29 +0000)
The target buffer was not large enough.

ChangeLog
NEWS
src/lib/elm_entry.c

index 99a016c0a1a09291327817ab83977f2f89803e7b..f5384e2ed36fbdccacb42c70be8d69176a924c8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2013-03-02  Brian J. Lovin
 
         * Fix initial value of the spinner on the first mouse move.
+
+2013-03-11  Tom Hacohen (TAsn)
+
+       * Entry: Fixed a bug with text appending.
diff --git a/NEWS b/NEWS
index a525d3d56f92d8daea88d30e4727594344a1f36a..1b0a681b482d593f06999f73099528ae132ffe95 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ Fixes:
    * Fix elm_progressbar_pulse() to abort if pulsing not enabled
    * Fix scroller acceleration bug. It was accelerated even it's scrolled after finishing the previous scroll. This happens with page scroll enabled.
    * Fix initial value of the spinner on the first mouse move.
+   * Entry: Fixed a bug with text appending.
         
 Elementary 1.7.5
 
index 8684a7049eeaf459aacae62232cf8bd5d36a321e..793232433a0fb5bcf1f60c710c259ce455ed24bd 100644 (file)
@@ -2429,7 +2429,9 @@ _elm_entry_text_get(const Evas_Object *obj, const char *item)
         char *tmpbuf;
         size_t tlen;
         tlen = strlen(text);
-        tmpbuf = malloc(wd->append_text_len + 1);
+       /* FIXME: need that or we do copy unitialised data */
+        tmpbuf = calloc(1, tlen + sd->append_text_len -
+              sd->append_text_position + 1);
         if (!tmpbuf)
           {
              ERR("Failed to allocate memory for entry's text %p", obj);