summaryrefslogtreecommitdiff
path: root/lang_ext/lua/upb.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-22 11:31:32 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-22 11:31:32 -0800
commit6b574175dd43735a26f171de6b34c3f15bb50f12 (patch)
tree65c221be25cefb9d54c78e12e0ff641346bd272b /lang_ext/lua/upb.c
parentfd184f0df2e5e428873eadfaf1ae829d2e4d8e51 (diff)
Prevent the default message from getting mutated.
If a Lua program references the default message, it will be copied into a mutable object.
Diffstat (limited to 'lang_ext/lua/upb.c')
-rw-r--r--lang_ext/lua/upb.c2
1 files changed, 1 insertions, 1 deletions
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) &&
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback