[OpenBIOS] [PATCH] Fix mac label whole partition case

Alexander Graf agraf at suse.de
Thu Feb 14 02:02:57 CET 2013


Commit r1072 removed the check for NULL pointer strings in the mac
partition lookup. However, without that check we would end up dereferencing
this string pointer later, breaking my Debian Lenny test image.

Add the check back in. This fixes Lenny with quik again.

Signed-off-by: Alexander Graf <agraf at suse.de>
---
 packages/mac-parts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packages/mac-parts.c b/packages/mac-parts.c
index d0cba05..330d8a0 100644
--- a/packages/mac-parts.c
+++ b/packages/mac-parts.c
@@ -126,7 +126,7 @@ macparts_open( macparts_info_t *di )
 	 * Implement partition selection as per the PowerPC Microprocessor CHRP bindings
 	 */
 
-	if (parnum == 0) {
+	if (str == NULL || parnum == 0) {
 		/* According to the spec, partition 0 as well as no arguments means the whole disk */
 		offs = (long long)0;
 		size = (long long)__be32_to_cpu(dmap.sbBlkCount) * bs;
-- 
1.6.0.2




More information about the OpenBIOS mailing list