]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix types when iterating hash
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Jul 2017 18:17:51 +0000 (19:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Jul 2017 18:17:51 +0000 (19:17 +0100)
src/lua/lua_mimepart.c

index 8223b9fc53a576de3e035c8f960abf132bc8ffbc..01252055337c3c3fb47548d8b5b6402a91f7e112 100644 (file)
@@ -828,7 +828,7 @@ lua_mimepart_get_type_common (lua_State * L, gboolean full)
        struct rspamd_mime_part *part = lua_check_mimepart (L);
        GHashTableIter it;
        gpointer k, v;
-       rspamd_ftok_t *akey, *avalue;
+       struct rspamd_content_type_param *param;
 
        if (part == NULL) {
                lua_pushnil (L);
@@ -862,12 +862,12 @@ lua_mimepart_get_type_common (lua_State * L, gboolean full)
                g_hash_table_iter_init (&it, part->ct->attrs);
 
                while (g_hash_table_iter_next (&it, &k, &v)) {
-                       akey = k;
-                       avalue = v;
+                       param = v;
 
-                       if (akey->len > 0 && avalue->len > 0) {
-                               lua_pushlstring (L, akey->begin, akey->len);
-                               lua_pushlstring (L, avalue->begin, avalue->len);
+                       if (param->name.len > 0 && param->name.len > 0) {
+                               /* TODO: think about multiple values here */
+                               lua_pushlstring (L, param->name.begin, param->name.len);
+                               lua_pushlstring (L, param->value.begin, param->value.len);
                                lua_settable (L, -3);
                        }
                }