From: Vsevolod Stakhov Date: Tue, 14 Jul 2015 18:06:59 +0000 (+0100) Subject: Fix dereference of NULL pointer. X-Git-Tag: 1.0.0~368 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9efde9864c72997c24c8a0c4a0c5d73bdba28568;p=thirdparty%2Frspamd.git Fix dereference of NULL pointer. --- diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index a0ffd56e19..686e32160d 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