Commit
8db8295d824cd0c8cba9385e4635d6e311d69d3f added a regression that causes the program to crash when
touching the partition structure (pte) for BSD/OSF labels. Since DOS has its own initialization function,
allow BSD labels to use it as well.
Steps to reproduce:
$> fdisk bsd.img (obtained from blkid regression test files)
Command (m for help): p
...
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Segmentation fault
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
return 0;
if (check_osf_label()) {
+ /* intialize partitions for BSD as well */
+ dos_init();
if (!valid_part_table_flag(MBRbuffer)) {
disklabel = OSF_LABEL;
return 0;
set_nr_sects(p,0);
}
-static void dos_init(void)
+void dos_init(void)
{
int i;
extern void dos_delete_partition(int i);
extern int check_dos_label(void);
extern int is_dos_partition(int t);
+extern void dos_init(void);
#endif