diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-14 19:06:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-14 19:06:59 +0100 |
commit | 9efde9864c72997c24c8a0c4a0c5d73bdba28568 (patch) | |
tree | cc30098300d6a868fa7a642c91ffe0db688ff02f /src/libutil/upstream.c | |
parent | a21fb8ed5b1642031c2b612cac45d176e9fc00f8 (diff) | |
download | rspamd-9efde9864c72997c24c8a0c4a0c5d73bdba28568.tar.gz rspamd-9efde9864c72997c24c8a0c4a0c5d73bdba28568.zip |
Fix dereference of NULL pointer.
Diffstat (limited to 'src/libutil/upstream.c')
-rw-r--r-- | src/libutil/upstream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index a0ffd56e1..686e32160 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -353,13 +353,13 @@ rspamd_upstreams_create (void) gsize rspamd_upstreams_count (struct upstream_list *ups) { - return ups->ups->len; + return ups != NULL ? ups->ups->len : 0; } gsize rspamd_upstreams_alive (struct upstream_list *ups) { - return ups->alive->len; + return ups != NULL ? ups->alive->len : 0; } static void |