1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

mDNS: protect MDNSResponder::queryService against misuse (#7216)

* mDNS: protect MDNSResponder::queryService against misuse

* fix style
This commit is contained in:
david gauchard 2020-04-15 20:22:02 +02:00 committed by GitHub
parent e1789ddf0c
commit e5f4514847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -767,6 +767,12 @@ uint32_t MDNSResponder::queryService(const char* p_pcService,
const char* p_pcProtocol,
const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
{
if (0 == m_pUDPContext)
{
// safeguard against misuse
return 0;
}
DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
uint32_t u32Result = 0;