diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-12 12:40:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-12 12:40:46 +0100 |
commit | e180aa8a5b7a63af744c8704ba47caaaad6de05d (patch) | |
tree | 06520fab9eaa45816c8857ebdce27d7c024a48d3 /src | |
parent | 61a36e0d18b18ced16108608edf67f853f1e8100 (diff) | |
download | rspamd-e180aa8a5b7a63af744c8704ba47caaaad6de05d.tar.gz rspamd-e180aa8a5b7a63af744c8704ba47caaaad6de05d.zip |
Fix NULL fixed strings printing.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/printf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 67a2f3d98..c8c6ace42 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -486,12 +486,20 @@ rspamd_vprintf_common (rspamd_printf_append_func func, if (v) { RSPAMD_PRINTF_APPEND (v->str, v->len); } + else { + RSPAMD_PRINTF_APPEND ("(NULL)", 6); + } continue; case 'T': tok = va_arg (args, rspamd_ftok_t *); - RSPAMD_PRINTF_APPEND (tok->begin, tok->len); + if (tok) { + RSPAMD_PRINTF_APPEND (tok->begin, tok->len); + } + else { + RSPAMD_PRINTF_APPEND ("(NULL)", 6); + } continue; case 'v': @@ -499,6 +507,9 @@ rspamd_vprintf_common (rspamd_printf_append_func func, if (gs) { RSPAMD_PRINTF_APPEND (gs->str, gs->len); } + else { + RSPAMD_PRINTF_APPEND ("(NULL)", 6); + } continue; |