1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Check fec type in incoming messages in RLDP

This commit is contained in:
SpyCheese 2022-10-03 09:14:50 +03:00
parent b96ab80dfd
commit e05af05635
3 changed files with 36 additions and 18 deletions

View file

@ -125,6 +125,10 @@ void RldpTransferReceiverImpl::receive_part(fec::FecType fec_type, td::uint32 pa
}
if (!decoder_) {
if (offset_ + fec_type.size() > total_size_) {
VLOG(RLDP_NOTICE) << "failed to create decoder: data size in fec type is too big";
return;
}
auto D = fec_type.create_decoder();
if (D.is_error()) {
VLOG(RLDP_WARNING) << "failed to create decoder: " << D.move_as_error();