summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-07-05 09:38:20 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-07-05 09:38:20 +0200
commit654bc330a0f520df3e1fe213b54d17b4c8221e5c (patch)
tree10ca1b541b8bdbaa80d946110320cd4ab19a27ab /src
parent487579f04c7758741d8a65ca3cd516641d57baf3 (diff)
Add is_part_known_humax() to avoid NULL dereference.
Thanks to Adel KHALDI from Blue Frost Security GmbH for reporting the problem.
Diffstat (limited to 'src')
-rw-r--r--src/parthumax.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parthumax.c b/src/parthumax.c
index 9b4894e..adc757f 100644
--- a/src/parthumax.c
+++ b/src/parthumax.c
@@ -47,6 +47,7 @@ static int write_part_humax(disk_t *disk_car, const list_part_t *list_part, cons
static list_part_t *init_part_order_humax(const disk_t *disk_car, list_part_t *list_part);
static void set_next_status_humax(const disk_t *disk_car, partition_t *partition);
static int test_structure_humax(list_part_t *list_part);
+static int is_part_known_humax(const partition_t *partition);
static void init_structure_humax(const disk_t *disk_car,list_part_t *list_part, const int verbose);
static const char *get_partition_typename_humax(const partition_t *partition);
static unsigned int get_part_type_humax(const partition_t *partition);
@@ -91,9 +92,14 @@ arch_fnct_t arch_humax=
.init_structure=&init_structure_humax,
.erase_list_part=NULL,
.get_partition_typename=&get_partition_typename_humax,
- .is_part_known=NULL
+ .is_part_known=&is_part_known_humax
};
+static int is_part_known_humax(const partition_t *partition)
+{
+ return (partition->part_type_humax != PHUMAX_PARTITION);
+}
+
static unsigned int get_part_type_humax(const partition_t *partition)
{
return partition->part_type_humax;