<div dir="ltr">Applied.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 15, 2017 at 3:16 AM, Benjamin Marzinski <span dir="ltr"><<a href="mailto:bmarzins@redhat.com" target="_blank">bmarzins@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If the dos partition table is corrupted, kpartx can just keep creating<br>
the same partitions until it runs out of partition numbers. This check<br>
catches the recursion.<br>
<br>
Signed-off-by: Cedric Buissart <<a href="mailto:cbuissar@redhat.com">cbuissar@redhat.com</a>><br>
Signed-off-by: Benjamin Marzinski <<a href="mailto:bmarzins@redhat.com">bmarzins@redhat.com</a>><br>
---<br>
 kpartx/dos.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/kpartx/dos.c b/kpartx/dos.c<br>
index 64b27b6..4985152 100644<br>
--- a/kpartx/dos.c<br>
+++ b/kpartx/dos.c<br>
@@ -46,7 +46,7 @@ read_extended_partition(int fd, struct partition *ep, int en,<br>
                for (i=0; i<2; i++) {<br>
                        memcpy(&p, bp + 0x1be + i * sizeof (p), sizeof (p));<br>
                        if (is_extended(p.sys_type)) {<br>
-                               if (p.nr_sects && !moretodo) {<br>
+                               if (p.start_sect && p.nr_sects && !moretodo) {<br>
                                        next = start + sector_size_mul * le32_to_cpu(p.start_sect);<br>
                                        moretodo = 1;<br>
                                }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
</font></span></blockquote></div><br></div>