message: Check input buffer lenght
diff: @@ -138,12 +138,16 @@ impl<'a> From<&'a OperationsForBlock> for OperationKey {
  impl Decoder for OperationKey {
  #[inline]
  fn decode(bytes: &[u8]) -> Result<Self, SchemaError> {
  + if bytes.len() < HashType::BlockHash.size() + 1 {
  + Err(SchemaError::DecodeError)
  + } else {
  Ok(OperationKey {
  block_hash: BlockHash::try_from(&bytes[0..HashType::BlockHash.size()])?,
  validation_pass: bytes[HashType::BlockHash.size()],
  })
  }
  }
  +}
  impl Encoder for OperationKey {
  #[inline]
  @@ -188,4 +192,15 @@ mod tests {
  assert_eq!(expected, decoded);
  Ok(())
  }
  +
  + #[test]
  + fn operation_key_decode_underflow() -> Result<(), Error> {
  + let result = OperationKey::decode(&[0; 0]);
  + assert!(matches!(result, Err(SchemaError::DecodeError)));
  + let result = OperationKey::decode(&[0; 1]);
  + assert!(matches!(result, Err(SchemaError::DecodeError)));
  + let result = OperationKey::decode(&[0; HashType::BlockHash.size()]);
  + assert!(matches!(result, Err(SchemaError::DecodeError)));
  + Ok(())
  + }
  }
  