summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2022-01-18 00:55:13 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2022-01-18 00:55:13 +0000
commit4e2a4b87886cd85c0d65bb8314488f02c7facf7e (patch)
treecf5721d88f1453cdfbcb1885d38f67ec8cfb2e73
parent2362784bc0f71e9afdef2878aa230a98a86f8c60 (diff)
downloaddnsmasq-4e2a4b87886cd85c0d65bb8314488f02c7facf7e.tar.gz
Fix crash in PXE code with bad config.
-rw-r--r--debian/changelog2
-rw-r--r--src/rfc2131.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 2d823ad..837dacd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,6 @@
dnsmasq (2.87-1) unstable; urgency=low
- * New upstream. (closes: #1001209)
+ * New upstream. (closes: #1001209, #1003156)
* Include new NFTset support in the build.
* Fix crash on netboot with DNS server disabled. (closes: #996332)
* Fix rare lockup in DNSSEC. (closes: #1001576)
diff --git a/src/rfc2131.c b/src/rfc2131.c
index c902eb7..a99bb89 100644
--- a/src/rfc2131.c
+++ b/src/rfc2131.c
@@ -2200,8 +2200,9 @@ static int pxe_uefi_workaround(int pxe_arch, struct dhcp_netid *netid, struct dh
inet_ntop(AF_INET, &mess->siaddr, (char *)mess->sname, INET_ADDRSTRLEN);
}
- snprintf((char *)mess->file, sizeof(mess->file),
- strchr(found->basename, '.') ? "%s" : "%s.0", found->basename);
+ if (found->basename)
+ snprintf((char *)mess->file, sizeof(mess->file),
+ strchr(found->basename, '.') ? "%s" : "%s.0", found->basename);
return 1;
}