From: Karel Zak Date: Wed, 31 Mar 2010 14:38:51 +0000 (+0200) Subject: partx: fix infinite loop X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0;p=util-linux 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 --- 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;