From 6b574175dd43735a26f171de6b34c3f15bb50f12 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 22 Feb 2011 11:31:32 -0800 Subject: Prevent the default message from getting mutated. If a Lua program references the default message, it will be copied into a mutable object. --- lang_ext/lua/upb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lang_ext/lua/upb.c') diff --git a/lang_ext/lua/upb.c b/lang_ext/lua/upb.c index 460ac86..2e0102e 100644 --- a/lang_ext/lua/upb.c +++ b/lang_ext/lua/upb.c @@ -170,7 +170,7 @@ static void lupb_pushvalue(lua_State *L, upb_value val, upb_fielddef *f) { static upb_value lupb_getvalue(lua_State *L, int narg, upb_fielddef *f) { upb_value val; - lua_Number num; + lua_Number num = 0; if (!upb_issubmsg(f) && !upb_isstring(f) && f->type != UPB_TYPE(BOOL)) { num = luaL_checknumber(L, narg); if (f->type != UPB_TYPE(DOUBLE) && f->type != UPB_TYPE(FLOAT) && -- cgit v1.2.3