Bug 291 - dname.c: dname_valid may return 256
dname.c: dname_valid may return 256
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.4.1
All All
: P2 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-28 16:25 CET by Hua Zhang
Modified: 2010-01-06 11:55 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hua Zhang 2009-12-28 16:25:41 CET
I think the max domain length is 255 which includes the tailing null byte in wire format. But dname_valid() in dname.c will return of 256, if 256 length dname is given. It should be 0 as 256 is not valid length for domain name.

Line 81 in dname.c:

	if(len > LDNS_MAX_DOMAINLEN)

should be

	if(len >= LDNS_MAX_DOMAINLEN)
Comment 1 Wouter Wijngaards 2010-01-06 11:55:36 CET
Fixed in svn r1948.

Thanks for the report!
   Wouter