From: Vsevolod Stakhov Date: Wed, 7 Oct 2015 10:59:56 +0000 (+0100) Subject: Skip NULL fstrings and gstrings on printing. X-Git-Tag: 1.0.5~66^2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9a563389b1c9ecbbc696cbb5ab18ef8dbd394d24;p=rspamd.git Skip NULL fstrings and gstrings on printing. --- 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;