Re: [PATCH 7/6] nfsdcltrack: add a legacy transition mechanism

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

 



On Wed, Oct 3, 2012 at 9:54 AM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> On Wed, 3 Oct 2012 09:52:02 -0400
> Scott Lovenberg <scott.lovenberg@xxxxxxxxx> wrote:
>
>> On Wed, Oct 3, 2012 at 9:40 AM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
>> > On Wed, 3 Oct 2012 09:34:36 -0400
>> > Scott Lovenberg <scott.lovenberg@xxxxxxxxx> wrote:
>> >
>> >> On Wed, Oct 3, 2012 at 8:42 AM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
>> >> [snip]
>> >> > +               /* if there's a problem, then skip this entry */
>> >> > +               if (len < 0 || (size_t)len >= sizeof(blob)) {
>> >> > +                       xlog(L_WARNING, "%s: unable to build filename for %s!",
>> >> > +                               __func__, entry->d_name);
>> >> > +                       continue;
>> >> > +               }
>> >>
>> >> Is a len == 0 not a problem?
>> >>
>> >
>> > I'm not sure -- under what circumstances would it return 0?
>> >
>> > --
>> > Jeff Layton <jlayton@xxxxxxxxxx>
>>
>> I guess the only case would be if sizeof(blob) was 0, then snprintf
>> would return a value < 1 according to the SUSv2.  Apparently C99 says
>> the return value will be > 0.  I guess this is a non-issue?
>>
>
> I think so, yes. The main worry here is overrunning the buffer and I
> think the error checking I'm doing has that covered.
>
> --
> Jeff Layton <jlayton@xxxxxxxxxx>

Agreed.  Sorry for the noise. :)

-- 
Peace and Blessings,
-Scott.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux