g_label_ntfs_taste: Abort taste is recsize == 0
This will avoid a 0-byte read (in g_read_data()) leading to a panic, if previously read data are erroneous. Suggested by: John-Mark Gurney <jmg@funkthat.com>
This commit is contained in:
parent
105421ff81
commit
f5c1ef84f9
@ -115,7 +115,7 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
|
||||
|
||||
mftrecsz = (char)bf->bf_mftrecsz;
|
||||
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz);
|
||||
if (recsize % pp->sectorsize != 0)
|
||||
if (recsize == 0 || recsize % pp->sectorsize != 0)
|
||||
goto done;
|
||||
|
||||
voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps +
|
||||
|
Loading…
Reference in New Issue
Block a user