[syslinux] [PATCH 24/28] com32/chain: (partiter) dos_next_ebr() fixup

Michal Soltys soltys at ziu.info
Tue Jan 29 06:06:11 PST 2013


Make sure that *lba is set to 0, if start_lba in the record is 0. Not an
issue in any of the code using partiter currently, as that implies
either broken layout or a hole. Still useful for consistency with index
== -1 or when relax flag is set.

Signed-off-by: Michal Soltys <soltys at ziu.info>
---
 com32/chain/partiter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c
index a4dc13d..8d0c272 100644
--- a/com32/chain/partiter.c
+++ b/com32/chain/partiter.c
@@ -374,7 +374,7 @@ static int dos_next_ebr(struct part_iter *iter, uint32_t *lba,
 	    iter->dos.logskipcnt++;
 
 	if (dp[0].ostype || (iter->flags & PIF_STEPALL)) {
-	    *lba = iter->dos.cebr_lba + dp[0].start_lba;
+	    *lba = dp[0].start_lba ? iter->dos.cebr_lba + dp[0].start_lba : 0;
 	    *_dp = dp;
 	    return 0;
 	}
-- 
1.7.10.4



More information about the Syslinux mailing list