diff options
author | David Zeuthen <davidz@redhat.com> | 2006-10-04 16:10:40 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2006-11-06 15:50:40 -0500 |
commit | d6b69ff7e8f8510a833e71401b18c949c1f51074 (patch) | |
tree | 361a1d8eb509b558e017f921c78e685012883d34 | |
parent | 9c14f1e9ed9e4336e0110535a7d1c746d3bd2ba2 (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.
(cherry picked from 51b841cd59a73fc093535ddd9e512d3036ebbbc4 commit)
-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 6ede13f3..36078c0a 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: |