Fix crash in PXE code with bad config.

This commit is contained in:
Simon Kelley committed 2022-01-18 00:55:13 +00:00
1 parent 2362784bc0
commit 4e2a4b8788
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -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;
}