mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 19:52:44 +00:00
Allow for a zero length 'loader'.
This commit is contained in:
parent
2fbced6574
commit
8948542c2d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177933
@ -336,6 +336,8 @@ gethdr(int fd, struct hdr *hdr)
|
||||
if (sb.st_size > MAXU32)
|
||||
errx(1, "%s: Too big", fname);
|
||||
hdr->size = sb.st_size;
|
||||
if (!hdr->size)
|
||||
return;
|
||||
if ((p = mmap(NULL, hdr->size, PROT_READ, MAP_SHARED, fd,
|
||||
0)) == MAP_FAILED)
|
||||
err(2, "%s", fname);
|
||||
|
Loading…
Reference in New Issue
Block a user