diff options
author | David Zeuthen <davidz@redhat.com> | 2006-10-04 16:10:40 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2006-10-04 16:10:40 -0400 |
commit | 51b841cd59a73fc093535ddd9e512d3036ebbbc4 (patch) | |
tree | 95cae9bd37068829551fc1386f85a664494e34aa /partutil | |
parent | bc96ff3b760917f4431015d9782d3d70f8b337ea (diff) |
don't add non-existing partition entries for MS-DOS disk labels
I think the issue is that the users who run into this have broken
partition extended tables, e.g. we error out in the function
part_table_probe_msdos_extended() and thus return NULL for the
extended partition table. We then stuff a NULL pointer into the
entries list and that's causing the crash on freeing the partition
table or looking through entries. This patch should fix at least the
crashes.
Diffstat (limited to 'partutil')
-rw-r--r-- | partutil/partutil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/partutil/partutil.c b/partutil/partutil.c index 5da36d54..3a2c87be 100644 --- a/partutil/partutil.c +++ b/partutil/partutil.c @@ -585,7 +585,9 @@ part_table_parse_msdos (int fd, guint64 offset, guint64 size, gboolean *found_gp //HAL_INFO (("pe = %p", pe)); - p->entries = g_slist_append (p->entries, pe); + if (pe != NULL) { + p->entries = g_slist_append (p->entries, pe); + } } out: |