@@ -9,6 +9,11 @@ use std::collections::{BTreeMap, HashMap, HashSet};
usesuper::state::State;
/// Methods of [`Context`] related to computing bounds of memory objects.
modbounds_computation;
pubusebounds_computation::BoundsMetadata;
/// Methods of [`Context`] and other helper functions related to replacing parameter IDs with possible caller values.
modparam_replacement;
/// Trait implementations for the [`Context`] struct,
/// especially the implementation of the [forward interprocedural fixpoint context](`crate::analysis::forward_interprocedural_fixpoint::Context`) trait.
out_of_bounds_access_warnings.push(format!("The object bound is based on the possible source value {:#} for the object ID.",source.to_json_compact()));
}
// Replace the bound with `Top` to prevent duplicate CWE warnings with the same root cause.
out_of_bounds_access_warnings.push(format!("For the object ID {} access to the offset {} may be larger than the upper object bound of {}.",
out_of_bounds_access_warnings.push(format!("For the object ID {} access to the offset {} (size {}) may overflow the upper object bound of {}.",
id,
upper_offset+(u64::from(value_size)asi64),
upper_offset,
u64::from(value_size),
upper_bound,
));
iflet(
_,
Some(BoundsMetadata{
source:Some(source),
..
}),
)=context.compute_bounds_of_id(id,&self.stack_id)
{
out_of_bounds_access_warnings.push(format!("The object bound is based on the possible source value {:#} for the object ID.",source.to_json_compact()));
}
// Replace the bound with `Top` to prevent duplicate CWE warnings with the same root cause.