From 8ba64c8da6a6048ae932d9a90bf9620bda41e6f5 Mon Sep 17 00:00:00 2001 From: Julian Schmid Date: Mon, 24 Jun 2024 21:55:20 +0200 Subject: [PATCH] Restricted DltFtBuffer to 64bit systems --- src/ft/dlt_ft_buffer.rs | 2 +- src/ft/dlt_ft_pool.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ft/dlt_ft_buffer.rs b/src/ft/dlt_ft_buffer.rs index 8c4c189..e5ec46a 100644 --- a/src/ft/dlt_ft_buffer.rs +++ b/src/ft/dlt_ft_buffer.rs @@ -262,7 +262,7 @@ impl DltFtBuffer { } } -#[cfg(all(feature = "std",test))] +#[cfg(all(feature = "std", test))] mod test { use crate::ft::*; diff --git a/src/ft/dlt_ft_pool.rs b/src/ft/dlt_ft_pool.rs index 9cea73f..c36970f 100644 --- a/src/ft/dlt_ft_pool.rs +++ b/src/ft/dlt_ft_pool.rs @@ -13,8 +13,8 @@ use std::{collections::HashMap, vec::Vec}; /// If you use the [`DltFtPool`] in an untrusted environment an attacker could /// cause an "out of memory error" by opening up multiple parallel file transfer streams, /// never ending them and filling them up with as much data as possible. -#[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] +#[cfg(all(feature = "std", target_pointer_width = "64"))] +#[cfg_attr(docsrs, doc(cfg(all(feature = "std", target_pointer_width = "64"))))] #[derive(Debug, Default, Clone)] pub struct DltFtPool where @@ -28,8 +28,8 @@ where finished: Vec, } -#[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] +#[cfg(all(feature = "std", target_pointer_width = "64"))] +#[cfg_attr(docsrs, doc(cfg(all(feature = "std", target_pointer_width = "64"))))] impl DltFtPool where ChannelId: Hash + Eq + PartialEq + Clone + Sized, @@ -163,8 +163,8 @@ where } } -#[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] +#[cfg(all(feature = "std", target_pointer_width = "64"))] +#[cfg_attr(docsrs, doc(cfg(all(feature = "std", target_pointer_width = "64"))))] impl PartialEq for DltFtPool where ChannelId: Hash + Eq + PartialEq + Clone + Sized, @@ -175,8 +175,8 @@ where } } -#[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] +#[cfg(all(feature = "std", target_pointer_width = "64"))] +#[cfg_attr(docsrs, doc(cfg(all(feature = "std", target_pointer_width = "64"))))] impl Eq for DltFtPool where ChannelId: Hash + Eq + PartialEq + Clone + Sized, @@ -184,7 +184,7 @@ where { } -#[cfg(all(feature = "std", test))] +#[cfg(all(feature = "std", target_pointer_width = "64", test))] mod tests { use super::*; use alloc::format;