From 0e0aa7bac5ca53276abbb1c6ffedde178ff8bf68 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 11 Jun 2004 19:27:50 +0000 Subject: [PATCH] disconnect servers that send missaligned protocol --- src/ca/tcpiiu.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 6ddae1bf1..33eb966fa 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -1090,6 +1090,15 @@ bool tcpiiu::processIncoming ( # endif } + // check for 8 byte aligned protocol + if ( ( ( this->curMsg.m_postsize >> 3 ) << 3 ) + != this->curMsg.m_postsize ) { + this->printf ( mgr.cbGuard, + "CAC: server sent missaligned payload 0x%x\n", + this->curMsg.m_postsize ); + return false; + } + // // make sure we have a large enough message body cache //