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.

Submitter:  user name <username>
Submitted:  Wed 19 Apr 2017 01:58:16 AM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned 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>
Group administrator
Wed 19 Apr 2017 04:36:15 AM UTC, comment #1: 

Yes, thanks for the patch!

Dirk Ziegelmeier <dziegel>
Group administrator
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-19 dziegel StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code