diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-24 21:42:11 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-24 21:42:11 +0100 |
commit | 74e8f0076bcc78fc34a1e44de386ddbf79628159 (patch) | |
tree | fd6a0515d3404549afa4ec2a6e5f9665feb5a14c /src | |
parent | 40e941010dba190c6272375da2e763466ebd8ba9 (diff) | |
download | rspamd-74e8f0076bcc78fc34a1e44de386ddbf79628159.tar.gz rspamd-74e8f0076bcc78fc34a1e44de386ddbf79628159.zip |
[Minor] Workaround for \0 character (poor API choice)
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/controller.c b/src/controller.c index 8440beb8e..1f8524b84 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3467,7 +3467,10 @@ rspamd_controller_register_plugin_path (lua_State *L, rspamd_http_router_add_path (ctx->http, full_path->str, rspamd_controller_handle_lua_plugin); - g_hash_table_insert (ctx->plugins, rspamd_ftok_map (full_path), cbd); + rspamd_ftok_t *key_tok = rspamd_ftok_map (full_path); + /* Truncate stupid \0 symbol to enable lookup */ + key_tok->len --; + g_hash_table_insert (ctx->plugins, key_tok, cbd); } static void |