bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] SIGFPE when fat cluster size is 0


From: Matt Wilson
Subject: [PATCH] SIGFPE when fat cluster size is 0
Date: Thu, 7 Nov 2002 16:40:22 -0500
User-agent: Mutt/1.2.5.1i

This patch corrects a divide by zero in bootsector.c:97 if
cluster_size is 0.  Basically fat_probe() would do
fat_boot_sector_analyse(), which would return 0.  Then it would try to
figure out the fat type, which calls fat_boot_sector_probe_type().
This would SIGFPE.  The call to fat_boot_sector_probe_type() was
overkill anyway since it's already called in fat_boot_sector_analyse()
anyway to set fs_info->fat_type.

--- parted-1.6.3/libparted/fs_fat/fat.c.orig    2002-11-07 16:26:44.000000000 
-0500
+++ parted-1.6.3/libparted/fs_fat/fat.c 2002-11-07 16:26:30.000000000 -0500
@@ -123,12 +123,8 @@
 
        if (!fat_boot_sector_read (&fs_info->boot_sector, geom))
                goto error_free_fs;
-       if (!fat_boot_sector_analyse (&fs_info->boot_sector, fs)) {
-               *fat_type = fat_boot_sector_probe_type (&fs_info->boot_sector,
-                                                       geom);
-               fat_free (fs);
-               return ped_geometry_duplicate (geom);
-       }
+       if (!fat_boot_sector_analyse (&fs_info->boot_sector, fs))
+               goto error_free_fs;
 
        *fat_type = fs_info->fat_type;
        result = ped_geometry_new (geom->dev, geom->start,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]