q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=099bdd781990493d0690a694f7898a51db3af73f

commit 099bdd781990493d0690a694f7898a51db3af73f
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Wed Jul 15 15:32:53 2015 +0100

    eolian: do not use an invalid pointer after updating buffer
    
    Replacing decimal point in buffer resulted in invalidation of the original
    string pointer. On Linux, this issue was for some reason not caught, but
    it was wrong anyway. Use the updated string correctly now.
    
    @fix
---
 src/lib/eolian/eo_lexer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index cc6531d..35bb3d0 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -621,19 +621,19 @@ write_val_with_decpoint(Eo_Lexer *ls, Eo_Token *tok, int 
type)
 static void
 write_val(Eo_Lexer *ls, Eo_Token *tok, Eina_Bool is_float)
 {
-   const char *str = eina_strbuf_string_get(ls->buff);
    int type = get_type(ls, is_float);
    char *end = NULL;
    if (is_float)
      {
         replace_decpoint(ls, '.');
         if (type == NUM_FLOAT)
-          tok->value.f = strtof(str, &end);
+          tok->value.f = strtof(eina_strbuf_string_get(ls->buff), &end);
         else if (type == NUM_DOUBLE)
-          tok->value.d = strtod(str, &end);
+          tok->value.d = strtod(eina_strbuf_string_get(ls->buff), &end);
      }
    else
      {
+        const char *str = eina_strbuf_string_get(ls->buff);
         /* signed is always in the same memory location */
         if (type == NUM_INT || type == NUM_UINT)
           tok->value.u = strtoul(str, &end, 0);

-- 


Reply via email to