[Parted-commits] GNU Parted Official Repository: Changes to 'stable-1.8.x'
David Cantrell
dcantrell-guest at alioth.debian.org
Thu Aug 9 15:29:21 UTC 2007
libparted/arch/linux.c | 7 +++++--
libparted/device.c | 3 ---
2 files changed, 5 insertions(+), 5 deletions(-)
New commits:
commit be2ace6e8d381fb836647234ac65d34a4a547e31
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Wed Aug 8 18:04:00 2007 -0400
Sanity check for dev, safety checks on diobuf.
Make sure diobuf is NULL before we begin and make sure it isn't NULL when
we try to free it. Throw an exception if dev is NULL and we enter this
function.
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index cb9605f..462ab92 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1446,8 +1446,9 @@ linux_read (const PedDevice* dev, void* buffer, PedSector start,
{
LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
PedExceptionOption ex_status;
- void* diobuf;
+ void* diobuf = NULL;
+ PED_ASSERT (dev != NULL, return 0);
PED_ASSERT (dev->sector_size % PED_SECTOR_SIZE_DEFAULT == 0, return 0);
if (_get_linux_version() < KERNEL_VERSION (2,6,0)) {
@@ -1528,7 +1529,9 @@ linux_read (const PedDevice* dev, void* buffer, PedSector start,
break;
}
}
- free(diobuf);
+
+ if (diobuf)
+ free(diobuf);
return 1;
}
commit 4982d20086ea0b3d4ffdcd4d66da298fa923c762
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Wed Aug 8 18:02:37 2007 -0400
Revert ped_disk_new() check from the other day.
Do not try to call ped_disk_new() from ped_device_get().
diff --git a/libparted/device.c b/libparted/device.c
index 17321cd..fddf9b4 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -190,9 +190,6 @@ ped_device_get (const char* path)
if (!walk)
return NULL;
- if (!ped_disk_new (walk))
- return NULL;
-
_device_register (walk);
return walk;
}
More information about the Parted-commits
mailing list