From: Aki Tuomi Date: Sun, 9 Feb 2014 17:23:17 +0000 (+0200) Subject: Added comment why the compiler nit is acceptable here. X-Git-Tag: rec-3.6.0-rc1~186^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1270%2Fhead;p=thirdparty%2Fpdns.git Added comment why the compiler nit is acceptable here. --- 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<