Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DNSServer crash #6354

Merged
merged 1 commit into from
Feb 28, 2022
Merged

Fix DNSServer crash #6354

merged 1 commit into from
Feb 28, 2022

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