Drop connection if IA length > 68 (BtHandshakeMessage::MESSAGE_LENGTH).

pull/1/head
Tatsuhiro Tsujikawa 2011-01-08 18:12:44 +09:00
parent acfb290eca
commit 2ee68ec8ad
1 changed files with 3 additions and 1 deletions

View File

@ -490,7 +490,9 @@ bool MSEHandshake::receiveReceiverIALength()
return false;
}
iaLength_ = decodeLength16(rbuf_);
// TODO limit iaLength \19...+handshake
if(iaLength_ > BtHandshakeMessage::MESSAGE_LENGTH) {
throw DL_ABORT_EX(fmt("Too large IA length length: %u", iaLength_));
}
A2_LOG_DEBUG(fmt("CUID#%lld - len(IA)=%u.", cuid_, iaLength_));
// shift rbuf_
shiftBuffer(2);