diff options
author | Petr Vaněk <arkamar@atlas.cz> | 2024-10-02 15:01:07 +0200 |
---|---|---|
committer | Petr Vaněk <arkamar@atlas.cz> | 2024-10-02 15:17:42 +0200 |
commit | 3041484f859f3d8cc2275c5189280c31ff3ffeda (patch) | |
tree | c8a7370e652a9a89397d2aa6443a6ca26c2fffb5 /contrib | |
parent | da5fa7ec0d65e6cdcd6211c6b4dc87c467eef354 (diff) | |
download | rspamd-3041484f859f3d8cc2275c5189280c31ff3ffeda.tar.gz rspamd-3041484f859f3d8cc2275c5189280c31ff3ffeda.zip |
[Fix] Use correct type for keylen in lua_ucl_newindex
The keylen variable used in lua_ucl_newindex function should use size_t
type instead of lua_Integer, because all functions that use keylen
expect it to be of size_t type. This mismatch leads to incompatible
pointer types, and modern versions of GCC fail to compile the code.
Fixes: 9e87597ceb05 ("[Project] Allow manipulations with opaque UCL objects")
Issue: https://github.com/rspamd/rspamd/issues/5163
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libucl/lua_ucl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index 19ac9cb12..473aefe0c 100644 --- a/contrib/libucl/lua_ucl.c +++ b/contrib/libucl/lua_ucl.c @@ -1426,7 +1426,7 @@ lua_ucl_newindex(lua_State *L) if (ucl_object_type(obj) == UCL_OBJECT) { if (key_type == LUA_TSTRING) { - lua_Integer keylen; + size_t keylen; const char *key = lua_tolstring(L, 2, &keylen); ucl_object_t *value_obj = lua_ucl_object_get(L, 3); @@ -1539,7 +1539,7 @@ lua_ucl_newindex(lua_State *L) obj->value.av = NULL; obj->type = UCL_OBJECT; - lua_Integer keylen; + size_t keylen; const char *key = lua_tolstring(L, 2, &keylen); ucl_object_t *value_obj = lua_ucl_object_get(L, 3); |