Package: e2fsprogs

In lib/ext2fs/icount.c(get_icount_el) there is some code which looks like this:

                        /* Interpolate for efficiency */
                        lowval = icount->list[low].ino;
                        highval = icount->list[high].ino;

                        if (ino < lowval)
                                range = 0;
                        else if (ino > highval)
                                range = 1;
                        else
                                range = ((float) (ino - lowval)) /
                                        (highval - lowval);
                        mid = low + ((int) (range * (high-low)));

I had a file system where range ended up being 1.0f, low being 0 and high being a large number.

Due to how floating point works, this meant mid ended up being > high and the while loop never terminated.

Clamping the mid value to be <= high and >= low fixed this problem.

- tfheen


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to