]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to parse GString memory pool vars
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 23 Sep 2016 12:45:19 +0000 (13:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 23 Sep 2016 12:45:19 +0000 (13:45 +0100)
src/lua/lua_mempool.c

index 15d0e689748e27e64dd8ad28c7e8f72b8a7c1d80..38482748f3b093af680ba24f4984aef0a2dc5097 100644 (file)
@@ -374,6 +374,12 @@ lua_mempool_get_variable (lua_State *L)
                                                lua_pushlstring (L, (const gchar *)pv, slen);
                                                pv += slen + 1;
                                        }
+                                       else if (len == sizeof ("gstring") - 1 &&
+                                                       g_ascii_strncasecmp (pt, "gstring", len) == 0) {
+                                               GString *st = (GString *)pv;
+                                               lua_pushlstring (L, st->str, st->len);
+                                               pv += sizeof (GString *);
+                                       }
                                        else {
                                                msg_err ("unknown type for get_variable: %s", pt);
                                                lua_pushnil (L);