Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/alccodec/alcraptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ impl AlcCodec for AlcRaptor {
let n = fti[12];
let al = fti[13];

if symbol_size == 0 {
return Err(FluteError::new("Symbol size is null"));
}

if z == 0 {
return Err(FluteError::new("Z is null"));
}
Expand Down
4 changes: 4 additions & 0 deletions src/common/alccodec/alcraptorq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ impl AlcCodec for AlcRaptorQ {
al
);

if symbol_size == 0 {
return Err(FluteError::new("Symbol size is null"));
}

if z == 0 {
return Err(FluteError::new("Z is null"));
}
Expand Down
6 changes: 6 additions & 0 deletions src/receiver/blockdecoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ impl BlockDecoder {
return;
}

debug_assert!(self.decoder.is_some());
if self.decoder.is_none() {
log::error!("Decoder has been deallocated");
return;
}

let payload = &pkt.data[pkt.data_payload_offset..];
let decoder = self.decoder.as_mut().unwrap();
decoder.push_symbol(payload, payload_id.esi);
Expand Down
4 changes: 4 additions & 0 deletions src/sender/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ impl Block {
block_length: u64,
oti: &Oti,
) -> Result<Box<Block>> {
if oti.encoding_symbol_length == 0 {
return Err(FluteError::new("Encoding symbol length is null"));
}

let nb_source_symbols: usize =
num_integer::div_ceil(buffer.len(), oti.encoding_symbol_length as usize);
log::debug!(
Expand Down
Loading