Git Product home page Git Product logo

dnsserver---esp32's Introduction

DNSServer

ESP8266/ESP32 DNSServer library

This is an experimental port of the DNSServer library that should work on ESP8266 and ESP32. This is NOT an official repo supported by Espressif. Do not depend on this code for anything important or expect it to be updated. Once the official repo is created, this repo will be deleted.

dnsserver---esp32's People

Contributors

zhouhan0126 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dnsserver---esp32's Issues

Type of license

Hi, what type of license is associated with your library? LGPL 2.1, MIT?
Thank you!

Crash in combination with ESPAsyncWebserver / Buffer overrun

Hi all,

I ran into a problem using the DNSServer in combination with the ESPAsyncWebserver:

If I open a web site, when connected to the ESP-AP the server does not respond (in fact it gets no IP). I found the cause in the following function:

`String DNSServer::getDomainNameWithoutWwwPrefix()
{
// Error checking : if the buffer containing the DNS request is a null pointer, return an empty domain
String parsedDomainName = "";
if (_buffer == NULL)
return parsedDomainName;

// Set the start of the domain just after the header (12 bytes). If equal to null character, return an empty domain
unsigned char *start = _buffer + DNS_OFFSET_DOMAIN_NAME;
if (*start == 0)
{
return parsedDomainName;
}

int pos = 0;

while(pos < _currentPacketSize)
{
unsigned char labelLength = (start + pos);
for(int i = 0; i < labelLength; i++)
{
pos++;
parsedDomainName += (char)
(start + pos);
}
pos++;
if (*(start + pos) == 0)
{
downcaseAndRemoveWwwPrefix(parsedDomainName);
return parsedDomainName;
}
else
{
parsedDomainName += ".";
}
}

return parsedDomainName;
}`

Initially, the while-loop was while(true), which created the problem, that if the udp packet is not formed correctly, it runs into a buffer overrun...

I corrected it, hope that helps....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.