Re: [PATCH 1/2] dir.c: fix uninitialized memory warning

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

 



On Thu, Sep 16, 2010 at 7:04 PM, Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote:
> On Fri, Sep 17, 2010 at 10:32 AM, Pat Notz <patnotz@xxxxxxxxx> wrote:
>>> I don't see any case that "size" can be used uninitialized. Maybe the
>>> compiler was confused by
>>>
>>> if (!check_index ||
>>>    (buf = read_skip_worktree_file_from_index(fname, &size)) == NULL)
>>>        return -1;
>>>
>>
>> No, line 245: if(size==0)
>
> The only chance for that line to be executed is read_skip_*() is
> executed and returns non-NULL buf. read_skip*() returns a non-NULL
> buffer at the end of function and does set size right before
> returning.
>
> To me it looks like a false alarm. But again, no objection to the patch.

I agree that it's a false alarm which is why I wasn't too interested
in looking into it very deeply.  Just looking to keep the code warning
free is all.

> --
> Duy
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]