From 9a563389b1c9ecbbc696cbb5ab18ef8dbd394d24 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 7 Oct 2015 11:59:56 +0100 Subject: [PATCH] Skip NULL fstrings and gstrings on printing. --- src/libutil/printf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 345682f28..3813524a0 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -485,7 +485,9 @@ rspamd_vprintf_common (rspamd_printf_append_func func, case 'V': v = va_arg (args, rspamd_fstring_t *); - RSPAMD_PRINTF_APPEND (v->str, v->len); + if (v) { + RSPAMD_PRINTF_APPEND (v->str, v->len); + } continue; @@ -496,7 +498,9 @@ rspamd_vprintf_common (rspamd_printf_append_func func, case 'v': gs = va_arg (args, GString *); - RSPAMD_PRINTF_APPEND (gs->str, gs->len); + if (gs) { + RSPAMD_PRINTF_APPEND (gs->str, gs->len); + } continue; -- 2.39.5