]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Added comment why the compiler nit is acceptable here. 1270/head
authorAki Tuomi <cmouse@desteem.org>
Sun, 9 Feb 2014 17:23:17 +0000 (19:23 +0200)
committerAki Tuomi <cmouse@desteem.org>
Sun, 9 Feb 2014 17:23:17 +0000 (19:23 +0200)
pdns/tcpreceiver.cc

index 6f1e4b239d7925d0835fb997fb4eedfca7494a73..76f3d23617457fbc5e8ace400b87ace4f29fc86d 100644 (file)
@@ -271,6 +271,13 @@ void *TCPNameserver::doConnection(void *data)
       else
         pktlen=ntohs(pktlen);
 
+      // this check will always be false *if* no one touches
+      // the mesg array. pktlen can be maximum of 65535 as
+      // it is 2 byte unsigned variable. In getQuestion, we 
+      // write to 0 up to pktlen-1 so 65535 is just right. 
+
+      // do not remove this check as it will catch if someone
+      // decreases the mesg buffer size for some reason. 
       if(pktlen>sizeof(mesg)) {
         L<<Logger::Error<<"Received an overly large question from "<<remote.toString()<<", dropping"<<endl;
         break;