From 55831567255f447cf0babfa65f4c9cf556c553b8 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 1 Mar 2013 02:10:53 +0000 Subject: [PATCH] Check for an empty host batch before ping scanning. This was a regression related to target deferral. It caused a null pointer dereference if all your targets failed to resolve or were excluded. --- targets.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets.cc b/targets.cc index b0fdacaf2..513adf9b5 100644 --- a/targets.cc +++ b/targets.cc @@ -598,6 +598,9 @@ static void refresh_hostbatch(HostGroupState *hs, const addrset *exclude_group, hs->hostbatch[hs->current_batch_sz++] = t; } + if (hs->current_batch_sz == 0) + return; + /* OK, now we have our complete batch of entries. The next step is to randomize them (if requested) */ if (hs->randomize) {