From 366e1e5e2908306c66ec4cb0832ba6557bfbf4c3 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sun, 9 Feb 2014 19:23:17 +0200 Subject: [PATCH] Added comment why the compiler nit is acceptable here. --- pdns/tcpreceiver.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 6f1e4b239d..76f3d23617 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -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<