[Rpm-maint] [rpm-software-management/rpm] rpm-4.14.0/tools/debugedit.c:2144]: (style) Array index 'lndx' is used before limits check. (#332)
Panu Matilainen
pmatilai at redhat.com
Mon Oct 16 09:43:29 UTC 2017
On 10/14/2017 12:28 AM, Mark Wielaard wrote:
> On Fri, Oct 13, 2017 at 07:30:01AM +0000, dcb314 wrote:
>> Source code is
>>
>> while (r_offset > (dso->lines.table[lndx].old_idx
>> + 4
>> + dso->lines.table[lndx].unit_length)
>> && lndx < dso->lines.used)
>> lndx++;
>>
>> Suggest limit check array index before use, not after.
>
> Yes, nice catch. The conditions should be swapped.
> Patch attached.
>
Applied, thanks!
- Panu -
More information about the Rpm-maint
mailing list