]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix logging buffer corruption in case of repeated messages
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Feb 2018 11:04:24 +0000 (11:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Feb 2018 11:04:24 +0000 (11:04 +0000)
src/libutil/logger.c

index 4d28e28fd322ffaa6a7f060b93510e2c91171c15..629ae8a1203420e49741a280c16da6c4527e61eb 100644 (file)
@@ -863,7 +863,8 @@ file_log_function (const gchar *module, const gchar *id,
                const gchar *message,
                gpointer arg)
 {
-       static gchar tmpbuf[256], timebuf[64], modulebuf[64];
+       static gchar timebuf[64], modulebuf[64];
+       gchar tmpbuf[256];
        gchar *m;
        gdouble now;
        struct tm tms;
@@ -967,6 +968,7 @@ file_log_function (const gchar *module, const gchar *id,
                                                "Last message repeated %ud times",
                                                rspamd_log->repeats);
                                rspamd_log->repeats = 0;
+
                                if (rspamd_log->saved_message) {
                                        file_log_function (rspamd_log->saved_module,
                                                        rspamd_log->saved_id,