loader: validate sectorsize argument in disk_open()
The bug and patch is reported against 11.2, but it is good idea to have the check in place for all versions. PR: 236585 Submitted by: john@feith.com Reported by: john@feith.com MFC after: 1 day
This commit is contained in:
parent
b4967c9b6f
commit
15f5e297d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347142
@ -221,6 +221,10 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize)
|
||||
struct ptable_entry part;
|
||||
int rc, slice, partition;
|
||||
|
||||
if (sectorsize == 0) {
|
||||
DPRINTF("unknown sector size");
|
||||
return (ENXIO);
|
||||
}
|
||||
rc = 0;
|
||||
od = (struct open_disk *)malloc(sizeof(struct open_disk));
|
||||
if (od == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user