cppcheck Sept 18
jjmckenzie51 at earthlink.net
Sun Sep 20 16:18:58 CDT 2009
>From: Henri Verbeet <hverbeet at gmail.com>
>Sent: Sep 20, 2009 12:19 PM
>To: Pauli Nieminen <suokkos at gmail.com>
>Cc: wine-devel at winehq.org, Joris Huizer <joris_huizer at yahoo.com>
>Subject: Re: cppcheck Sept 18
>2009/9/20 Pauli Nieminen <suokkos at gmail.com>
>> On Sat, Sep 19, 2009 at 1:59 PM, Joris Huizer <joris_huizer at yahoo.com> wrote:
>>> [/home/cahrendt/wine-git/dlls/rpcrt4/tests/server.c:1189]: (possible
>>> error) Array index out of bounds
>>> This one is a false positive, it uses FIELD_OFFSET(cs_t, ca),
>>> and it found an array:
>>> int ca;
>> int ca;
>> has only entries up to ca (0-4) so to me it looks like bug.
>Not quite. For one, the ca that's being used here isn't the local
>variable ca, but the field ca of the cs_t structure. The
>expression is used as a way to calculate the size of a cs_t structure
>with 5 elements.
But what is the real size of ca? Is it five, fifty or five-hundred? Maybe that is why the cppcheck is declaring it out-of-bounds.
More information about the wine-devel