Skip to content

Conversation

BlueAndi
Copy link
Contributor

@BlueAndi BlueAndi commented Feb 27, 2022

Summary

Because of the changes in #6206 it is necessary to change the QNameLength datatype to uint16_t, to be able to address the QName max. size of 256.

Impact

The problem appears int the following lines from the DNSServer.cpp if QNameLength is 255. The wrap around destroys the following memcpy.

_dnsQuestion->QName[_dnsQuestion->QNameLength] = 0 ;
_dnsQuestion->QNameLength++ ;
// Copy the QType and QClass
memcpy( &_dnsQuestion->QType, (void*) &_buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength], sizeof(_dnsQuestion->QType) ) ;
memcpy( &_dnsQuestion->QClass, (void*) &_buffer[DNS_HEADER_SIZE + _dnsQuestion->QNameLength + sizeof(_dnsQuestion->QType)], sizeof(_dnsQuestion->QClass) ) ;

… address it. Therefore the datatype was changed to uint16_t.
@CLAassistant
Copy link

CLAassistant commented Feb 27, 2022

CLA assistant check
All committers have signed the CLA.

@me-no-dev me-no-dev merged commit bf58ab6 into espressif:master Feb 28, 2022
@me-no-dev
Copy link
Member

thanks @BlueAndi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants