This is a regession introduced in
3b6df06fb8cb3652d2e7afd085fae3f416408013.
When dnsmasq is started without upstreams (yet), but a
DNS query comes in that needs forwarding dnsmasq now potentially crashes as
the value for "first" variable is undetermined.
A segmentation violation occurs when the index
is out of bounds of serverarray.
Credits go to pedro0311 <pedro@freshtomato.org>
flags = 0;
}
- master = daemon->serverarray[first];
-
/* don't forward A or AAAA queries for simple names, except the empty name */
if (!flags &&
option_bool(OPT_NODOTS_LOCAL) &&
/* Configured answer. */
if (flags || ede == EDE_NOT_READY)
goto reply;
-
+
+ master = daemon->serverarray[first];
+
if (!(forward = get_new_frec(now, master, 0)))
goto reply;
/* table full - flags == 0, return REFUSED */