From 7f44ea42b5620fb556418b06afd2917e3afbc19a Mon Sep 17 00:00:00 2001 From: Mike Morrison Date: Mon, 21 May 2018 23:39:40 -0700 Subject: [PATCH] fix issue with compressed pointer (issue 4648) --- libraries/ESP8266mDNS/ESP8266mDNS.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/ESP8266mDNS/ESP8266mDNS.cpp b/libraries/ESP8266mDNS/ESP8266mDNS.cpp index e155c9387a..2344b0833c 100644 --- a/libraries/ESP8266mDNS/ESP8266mDNS.cpp +++ b/libraries/ESP8266mDNS/ESP8266mDNS.cpp @@ -551,7 +551,8 @@ void MDNSResponder::_parsePacket(){ if (tmp8 & 0xC0) { // Compressed pointer uint16_t offset = ((((uint16_t)tmp8) & ~0xC0) << 8) | _conn_read8(); if (_conn->isValidOffset(offset)) { - last_bufferpos = _conn->tell(); + if (0 == last_bufferpos) + last_bufferpos = _conn->tell(); #ifdef DEBUG_ESP_MDNS_RX DEBUG_ESP_PORT.print("Compressed pointer, jumping from "); DEBUG_ESP_PORT.print(last_bufferpos);