Re: [PATCH 3/7] inflate pt1: clean up input logic

From: Matt Mackall
Date: Sat Feb 25 2006 - 09:55:31 EST


On Sat, Feb 25, 2006 at 08:49:55AM +0000, Russell King wrote:
> On Sat, Feb 25, 2006 at 12:51:36AM -0600, Matt Mackall wrote:
> > On Fri, Feb 24, 2006 at 10:19:09PM +0000, Russell King wrote:
> > > How does this change handle the case where we run out of input data?
> > > This condition needs to be handled explicitly because the inflate
> > > functions can infinitely loop.
> >
> > And if you look at the current users, you'll see that only two of 15
> > actually use it.
>
> Sorry, I don't understand the relevance of your comment.

The other 13 did the right thing, namely halt in get_byte. Without
adding a magic goto inside of a macro.

> Please do not back out this fix.

The backing out is only temporary, as I stated in my message. That
said, it should have never gone in.

> > > Relying on a bit pattern returned by get_byte() is how this code
> > > pre-fix used to work, and it caused several confused bug reports.
> >
> > Just about everywhere, get_byte prints an error message and halts.
>
> And the cases where it doesn't halt is the important case.

Again, current state of things. Did you read the rest of my message?

The end result is that it will halt in all cases. This code _will_not_
infinitely loop. Instead, it will dereference null or print a
diagnostic. I can add another patch to make sure it prints a nice
diagnostic in all cases if you care, but I don't think it's terribly
important.

--
Mathematics is the supreme nostalgia of our time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/