Re: [PATCH] nfs client, kernel 2.4.31: readlink result overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcelo Tosatti <[email protected]> writes:
> > That's one problem.
> > 
> > > If thats the reason, you don't need the "-1" there?
> > 
> > It also writes a 0 byte.  I think it looks like this:
> > 
> > ---- ------------ -
> > len  string...    0
> 
> If an overflow happens (len > rcvbuf->page_len) the last character will get 
> truncated anyway, so there is no need for the "-1" AFAICS.

I'm not sure I follow.

The code writes a 0 at rcvbuf->pages[0][sizeof(u32) + len], right?
Doesn't that make the maximum allowed value of len should be
'rcvbuf->page_len - sizeof(u32) - 1' ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux