[syslinux:elflink] com32/chain: (partiter) dos_next_ebr() fixup

syslinux-bot for Michal Soltys soltys at ziu.info
Sat Feb 16 01:48:16 PST 2013


Commit-ID:  4e761f7bc40ff810ba1e57efbd66fe9a82044658
Gitweb:     http://www.syslinux.org/commit/4e761f7bc40ff810ba1e57efbd66fe9a82044658
Author:     Michal Soltys <soltys at ziu.info>
AuthorDate: Thu, 14 Feb 2013 16:51:46 +0100
Committer:  Michal Soltys <soltys at ziu.info>
CommitDate: Thu, 14 Feb 2013 16:53:05 +0100

com32/chain: (partiter) dos_next_ebr() fixup

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;
 	}


More information about the Syslinux-commits mailing list