diff options
author | Karel Zak | 2010-03-31 16:38:51 +0200 |
---|---|---|
committer | Karel Zak | 2010-03-31 16:38:51 +0200 |
commit | c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0 (patch) | |
tree | 146baa26aa5b545516471a91b5cdd82134a4a1f4 | |
parent | partx: do not add nonexistent partitions (diff) | |
download | kernel-qcow2-util-linux-c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0.tar.gz kernel-qcow2-util-linux-c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0.tar.xz kernel-qcow2-util-linux-c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0.zip |
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 <psusi@cfl.rr.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | partx/partx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/partx/partx.c b/partx/partx.c index 3d60bf697..14d2609f0 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; |