]> source.dussan.org Git - rspamd.git/commitdiff
Skip NULL fstrings and gstrings on printing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 7 Oct 2015 10:59:56 +0000 (11:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 7 Oct 2015 10:59:56 +0000 (11:59 +0100)
src/libutil/printf.c

index 345682f2879bc784b3b06ade0d9625de449d140d..3813524a04d3a2069b7791034a976977ee6815e3 100644 (file)
@@ -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;