buglwIP - A Lightweight TCP/IP stack - Bugs: bug #41775, DNS_MAX_NAME_LENGTH is not valid...

 
 

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

bug #41775: DNS_MAX_NAME_LENGTH is not valid compare value for strlen

Submitter:  David Bydeley <dbydeley>
Submitted:  Wed 05 Mar 2014 02:16:24 AM UTC
   
 
Category:  DNS Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Duplicate
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.1

Tue 02 Sep 2014 07:39:20 PM UTC, comment #1: 

This is a duplicate to bug #37705 Possible memory corruption in DNS query, already fixed in git master a year and a half ago.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 05 Mar 2014 02:16:24 AM UTC, original submission:  

Function dns_gethostbyname uses DNS_MAX_NAME_LENGTH to check if the provided string name is not too long.
(strlen(hostname) >= DNS_MAX_NAME_LENGTH)

Function dns_send uses DNS_MAX_NAME_LENGTH to allocate a packet buffer large enough to hold the query format of the name.

While the string check in dns_gethostbyname does cover for the needed NULL termination (>=) it does not account for the additional first segment length byte at the beginning of the DNS name query.

Therefor a hostname string of DNS_MAX_NAME_LENGTH-1 will pass the check in dns_gethostbyname, but will result in an overrun of one character when you "convert hostname into suitable query format" in dns_send.

David Bydeley <dbydeley>

 

(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 dbydeley (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-02 goldsimon StatusNone Duplicate
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code