From d6817f4d6e48ab4a11bfb26bc953ab0d3528c9f4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 9 Aug 2016 11:19:11 +0900 Subject: [PATCH] evas filters: Fix minor issue with print If the call to tostring() fails, replace the string by (invalid) rather than ignore the error. Fixes CID 1308612 --- src/lib/evas/filters/evas_filter_parser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 7b33b042e7..d45b883a92 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -2202,8 +2202,13 @@ _lua_print(lua_State *L) lua_getglobal(L, _lua_errfunc_name); lua_getglobal(L, "tostring"); //+1 lua_pushvalue(L, i); //+1 - lua_pcall(L, 1, 1, -3); //-2/+1 - str = lua_tostring(L, -1); + if (lua_pcall(L, 1, 1, -3) == 0) //-2/+1 + str = lua_tostring(L, -1); + else + { + ERR("tostring() failed inside print(): %s", lua_tostring(L, -1)); + str = "(invalid)"; + } eina_strbuf_append(s, str ? str : "(nil)"); lua_pop(L, 2); eina_strbuf_append_char(s, ' ');