From 8ab5dd791fd53b7d88182cf264bc68221f814e89 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 21 Feb 2018 11:25:19 +0000 Subject: [PATCH] [Minor] Fix crash on empty debug module check --- src/libutil/logger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 6b83ddb05..4d28e28fd 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -1393,6 +1393,10 @@ rspamd_logger_add_debug_module (const gchar *mname) { struct rspamd_log_module *m; + if (mname == NULL) { + return (guint)-1; + } + if (log_modules == NULL) { log_modules = g_malloc0 (sizeof (*log_modules)); log_modules->modules = g_hash_table_new (rspamd_strcase_hash, -- 2.39.5