buglwIP - A Lightweight TCP/IP stack - Bugs: bug #50829, [CPPCHECK] Array index used before...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #50829: [CPPCHECK] Array index used before limits check.

Submitted by:  user name <username>
Submitted on:  Wed 19 Apr 2017 01:58:16 AM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Thu 20 Apr 2017 07:47:18 PM UTC, comment #2:

I'll have to add that this is a false positive.
'offset_max' is not a limit of the 'options' "array". Instead, 'options' is a pointer into a pbuf, the length is checked at the end of the array.
This change doesn't hurt, but it does not fix anything!

Simon Goldschmidt <goldsimon>
Project Administrator
Wed 19 Apr 2017 04:36:15 AM UTC, comment #1:

Yes, thanks for the patch!

Dirk Ziegelmeier <dziegel>
Project Member
Wed 19 Apr 2017 01:58:16 AM UTC, original submission:

http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv4/dhcp.c#n1502

while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
should be
while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {

See https://jira.reactos.org/browse/CORE-8978 for more info.
Sorry I can't be much more helpful, I'm only a messenger, telling about an issue someone else found.

Patch credits should go to "Kudratov Olimjon".

user name <username>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by dziegel (Posted a comment)
  • -unavailable- added by username (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 19 Apr 2017 04:36:15 AM UTCdziegelStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1