X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Ffat.c;h=9a2e4784d8cee165ca97f5b5a0d65c99e4456d92;hb=e18e6d79996edeeb07e122f3582a688c3ef4f6b9;hp=61a94504381275845d6e399fa945238aadb37ad7;hpb=2bac6c64aa7808cafd7706d56887a97ba9f7817d;p=elogind.git diff --git a/extras/volume_id/lib/fat.c b/extras/volume_id/lib/fat.c index 61a945043..9a2e4784d 100644 --- a/extras/volume_id/lib/fat.c +++ b/extras/volume_id/lib/fat.c @@ -133,7 +133,7 @@ static uint8_t *get_attr_volume_id(struct vfat_dir_entry *dir, unsigned int coun return NULL; } -int volume_id_probe_vfat(struct volume_id *id, uint64_t off) +int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size) { struct vfat_super_block *vs; struct vfat_dir_entry *dir; @@ -349,7 +349,7 @@ fat32: /* set next cluster */ next = le32_to_cpu(*((uint32_t *) buf)) & 0x0fffffff; - if (next == 0) + if (next < 2 || next >= 0x0ffffff0) break; } if (maxloop == 0)