Re: [PATCH] Avoid buffer overflows in get_user_pages()

Jiri Kosina
2008-02-12T10:36:40Z

On Mon, 11 Feb 2008, Andrew Morton wrote:

> > + if (len <= 0)
> > + return 0;
> > /*
> > * Require read or write permissions.
> > * If 'force' is set, we only require the "MAY" flags.
> Can we just convert
> do {
> ...
> } while (len);
> into
> while (len) {
> ...
> }

How would that help?

Rather

while (len > 0) {
...
}

would do the trick.

--
Jiri Kosina