Skip to content

Commit ea4720b

Browse files
bikemikedevyte
authored andcommitted
fix issue with compressed pointer (issue 4648) (#4752)
1 parent 73d36bb commit ea4720b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/ESP8266mDNS/ESP8266mDNS.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ void MDNSResponder::_parsePacket(){
551551
if (tmp8 & 0xC0) { // Compressed pointer
552552
uint16_t offset = ((((uint16_t)tmp8) & ~0xC0) << 8) | _conn_read8();
553553
if (_conn->isValidOffset(offset)) {
554-
last_bufferpos = _conn->tell();
554+
if (0 == last_bufferpos)
555+
last_bufferpos = _conn->tell();
555556
#ifdef DEBUG_ESP_MDNS_RX
556557
DEBUG_ESP_PORT.print("Compressed pointer, jumping from ");
557558
DEBUG_ESP_PORT.print(last_bufferpos);

0 commit comments

Comments
 (0)