bug-parted
[Top][All Lists]
Advanced

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

Bug in libparted/fs/hfs/probe.c


From: Władysław Bodzek
Subject: Bug in libparted/fs/hfs/probe.c
Date: Tue, 23 May 2006 22:32:47 +0200
User-agent: Thunderbird 1.6a1 (Windows/20060119)

libparted/fs/hfs/probe.c - lines 40-48:
---- CUT HERE ----
int
hfsc_can_use_geom (PedGeometry* geom)
{
        PedDevice* dev;

        PED_ASSERT (geom != NULL, return 0);
        PED_ASSERT ((dev = geom->dev) != NULL, return 0);

        if (dev->sector_size != PED_SECTOR_SIZE_DEFAULT) {
---- CUT HERE ----

but if DEBUG is not defined PED_ASSERT becomes nothing (include/parted/debug.h:85):

---- CUT HERE ----
#define PED_ASSERT(cond, action)        while (0) {}
---- CUT HERE ----

so the line 46 should look like this:

---- CUT HERE ----
        dev = geom->dev; PED_ASSERT (dev != NULL, return 0);
---- CUT HERE ----

or something similar.


This solution works for me. I found the bug when I used parted with soem disk having unformatted partition (containing garbage).


--
| Wladyslaw Bodzek                                               |
| Institute of Computer Science, Poznan University of Technology |
| Piotrowo 2, 60-965 Poznan, Poland.                             |
| gg: #2103109   jabber: address@hidden   phone: +48616652994 |




reply via email to

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