]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: Fix sizeof usage for struct event* storage
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 6 Nov 2018 19:00:47 +0000 (21:00 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 14 Nov 2018 12:14:42 +0000 (14:14 +0200)
Found by coverity

src/lib-lua/dlua-dovecot.c

index 8aef36df896c834055da8f3ac75620ec1dac933c..e80b40e752d59176447da3ae0f876d602fa64b41 100644 (file)
@@ -280,7 +280,7 @@ void dlua_push_event(struct dlua_script *script, struct event *event)
        luaL_setmetatable(script->L, DLUA_EVENT);
 
        /* we need to attach gc to userdata to support older lua*/
-       struct event **ptr = lua_newuserdata(script->L, sizeof(struct event**));
+       struct event **ptr = lua_newuserdata(script->L, sizeof(struct event*));
        *ptr = event;
        lua_createtable(script->L, 0, 1);
        lua_pushcfunction(script->L, dlua_event_gc);