From c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 31 Mar 2010 16:38:51 +0200 Subject: [PATCH] partx: fix infinite loop On Wed, Mar 24, 2010 at 04:39:35PM -0400, Phillip Susi wrote: > I noticed that running partx -d /dev/sda hangs so I looked into it > and it seems that it keeps trying to delete partitions forever. Reported-By: Phillip Susi Signed-off-by: Karel Zak --- partx/partx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/partx/partx.c b/partx/partx.c index 3d60bf69..14d2609f 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -178,6 +178,8 @@ main(int argc, char **argv){ while (upper == 0 || lower <= upper) { int err; + if (lower > MAXSLICES) + break; pt.pno = lower; pt.start = 0; pt.length = 0; -- 2.39.5