In biosdisk_findpartition() check if part_name isn't NULL before

assigning *part_name.

Thanks to manu@ for the pointer.
This commit is contained in:
simonb 2021-12-28 00:37:16 +00:00
parent 314f8da246
commit 16ba9b01e7
1 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: biosdisk.c,v 1.56 2021/12/28 00:34:30 simonb Exp $ */
/* $NetBSD: biosdisk.c,v 1.57 2021/12/28 00:37:16 simonb Exp $ */
/*
* Copyright (c) 1996, 1998
@ -1028,7 +1028,8 @@ biosdisk_findpartition(int biosdev, daddr_t sector,
{
#if defined(NO_DISKLABEL) && defined(NO_GPT)
*partition = 0;
*part_name = NULL;
if (part_name)
*part_name = NULL;
return 0;
#else
int i;
@ -1047,7 +1048,8 @@ biosdisk_findpartition(int biosdev, daddr_t sector,
/* default to first partition */
*partition = 0;
*part_name = NULL;
if (part_name)
*part_name = NULL;
/* Look for netbsd partition that is the dos boot one */
d = alloc_biosdisk(biosdev);