Fix crash in PXE code with bad config.

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

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;
}