diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-07 11:59:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-07 11:59:56 +0100 |
commit | 9a563389b1c9ecbbc696cbb5ab18ef8dbd394d24 (patch) | |
tree | 470ef1496f3cbc5a389f90ee058b760e100365f5 /src/libutil/printf.c | |
parent | 60ce496100bbf7316c392a9b2b0a072edb6cfe07 (diff) | |
download | rspamd-9a563389b1c9ecbbc696cbb5ab18ef8dbd394d24.tar.gz rspamd-9a563389b1c9ecbbc696cbb5ab18ef8dbd394d24.zip |
Skip NULL fstrings and gstrings on printing.
Diffstat (limited to 'src/libutil/printf.c')
-rw-r--r-- | src/libutil/printf.c | 8 |
1 files 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; |