Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Thu Mar 04 12:08:14 2021 +0000
Parent:
193:47a953ab571b
Child:
195:bd5b123143ca
Commit message:
DnsNameDecodePtr buffer overrun warning removed as had too many 'amzn.dmgr:9D184A89EEDE554B15EABD4931BB839B:S/FRy5cPXE:914584' alerts. It now just silently truncates names which don't fit in the buffer.

Changed in this revision

udp/dns/dnsname.c Show annotated file Show diff for this revision Revisions of this file
--- a/udp/dns/dnsname.c	Sun Jan 24 15:09:55 2021 +0000
+++ b/udp/dns/dnsname.c	Thu Mar 04 12:08:14 2021 +0000
@@ -225,6 +225,7 @@
     bool nameStarted = false;
     int depth = 0;
     char* p = pStart;
+    char* pNameStart = pName;
     while (true)
     {
         if (p >= DnsHdrData + DnsHdrDataLength)
@@ -255,10 +256,11 @@
         {
             if (pName)
             {
-                if (length + 1 > lenName) //Leave room to terminate the string
+                if (length + 1 > lenName) //Leave room to terminate the string.
+                //Warning removed as had too many 'amzn.dmgr:9D184A89EEDE554B15EABD4931BB839B:S/FRy5cPXE:914584' alerts
                 {
                     *pName = 0;
-                    LogTimeF("DnsNameDecodePtr overran name buffer\r\n");
+                    //LogTimeF("DnsNameDecodePtr decoded name '%s' overran name buffer trying to add %d bytes\r\n", pNameStart, length);
                     return;
                 }
                 lenName -= length + 1; //name chunk plus a '.'