mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Check for constructed name in --srv-host exceeding length limit.
Thanks to Mikhail Dmitrichenko for spotting this.
This commit is contained in:
@@ -6262,6 +6262,8 @@ void read_opts(int argc, char **argv, char *compile_opts)
|
|||||||
strchr(srv->name, '.') &&
|
strchr(srv->name, '.') &&
|
||||||
strchr(srv->name, '.') == strrchr(srv->name, '.'))
|
strchr(srv->name, '.') == strrchr(srv->name, '.'))
|
||||||
{
|
{
|
||||||
|
if (strlen(srv->name) + 1 + strlen(daemon->domain_suffix) > MAXDNAME)
|
||||||
|
die(_("srv-host name %s too long after domain appended"), srv->name, EC_MISC);
|
||||||
strcpy(buff, srv->name);
|
strcpy(buff, srv->name);
|
||||||
strcat(buff, ".");
|
strcat(buff, ".");
|
||||||
strcat(buff, daemon->domain_suffix);
|
strcat(buff, daemon->domain_suffix);
|
||||||
|
|||||||
Reference in New Issue
Block a user