aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2012-08-30 04:36:15 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2012-08-31 14:04:09 +0200
commit20c2595f2de956f70f164fa3b822989e178f0459 (patch)
treeaa5cd920489a84c41e03d34c45e99add854c2827
parent89ec69b0670abc836862e6ae9608c99f608e065c (diff)
downloadlogdiag-20c2595f2de956f70f164fa3b822989e178f0459.tar.gz
logdiag-20c2595f2de956f70f164fa3b822989e178f0459.tar.xz
logdiag-20c2595f2de956f70f164fa3b822989e178f0459.zip
Check symbol names in LdLua during registration.
-rw-r--r--liblogdiag/ld-lua.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/liblogdiag/ld-lua.c b/liblogdiag/ld-lua.c
index 18bf9ce..935c2a1 100644
--- a/liblogdiag/ld-lua.c
+++ b/liblogdiag/ld-lua.c
@@ -492,6 +492,7 @@ static int
process_registration (lua_State *L)
{
LdLuaSymbol *symbol;
+ const gchar *name;
gchar *human_name;
int i, type, types[] =
@@ -508,7 +509,10 @@ process_registration (lua_State *L)
lua_typename (L, types[i]), lua_typename (L, type));
symbol = LD_LUA_SYMBOL (lua_touserdata (L, lua_upvalueindex (1)));
- symbol->priv->name = g_strdup (lua_tostring (L, 1));
+ name = lua_tostring (L, 1);
+ if (g_strstr_len (name, -1, LD_LIBRARY_IDENTIFIER_SEPARATOR))
+ return luaL_error (L, "Invalid symbol name.");
+ symbol->priv->name = g_strdup (name);
human_name = get_translation (L, 2);
if (!human_name)