mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2026-04-02 00:18:40 +01:00
Don't call qsort() with a NULL array when no servers defined.
This commit is contained in:
@@ -79,6 +79,8 @@ void build_server_array(void)
|
|||||||
for (serv = daemon->local_domains; serv; serv = serv->next, count++)
|
for (serv = daemon->local_domains; serv; serv = serv->next, count++)
|
||||||
daemon->serverarray[count] = serv;
|
daemon->serverarray[count] = serv;
|
||||||
|
|
||||||
|
/* serverarray may be unallocated if we have no servers yet. */
|
||||||
|
if (daemon->serverarray)
|
||||||
qsort(daemon->serverarray, daemon->serverarraysz, sizeof(struct server *), order_qsort);
|
qsort(daemon->serverarray, daemon->serverarraysz, sizeof(struct server *), order_qsort);
|
||||||
|
|
||||||
/* servers need the location in the array to find all the whole
|
/* servers need the location in the array to find all the whole
|
||||||
|
|||||||
Reference in New Issue
Block a user