[grilo-plugins] lua-factory: Fix garbage after escaped text in grl.unescape()



commit 6c7f503edd742b595fb29aa4ef986eb6306b1828
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 6 15:58:53 2014 +0200

    lua-factory: Fix garbage after escaped text in grl.unescape()
    
    grl.unescape('&quot;Look at Me&quot;')
    would give back:
    "Look at Me"t Me&quot;
    instead of:
    "Look at Me"
    
    Don't forget to terminate the copied string when we've unescaped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729649

 src/lua-factory/grl-lua-library.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/lua-factory/grl-lua-library.c b/src/lua-factory/grl-lua-library.c
index da968d1..db56e57 100644
--- a/src/lua-factory/grl-lua-library.c
+++ b/src/lua-factory/grl-lua-library.c
@@ -143,6 +143,8 @@ unescape_string (const char *orig_from)
     }
   }
 
+  *to = '\0';
+
   return ret;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]