Skip to content

Commit

Permalink
seperate pr for felt252 detector
Browse files Browse the repository at this point in the history
  • Loading branch information
technovision99 committed Sep 5, 2023
1 parent 5eafe2b commit c1779da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/detectors/felt252_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ pub struct Felt252Overflow {}

impl Detector for Felt252Overflow {
fn name(&self) -> &str {
"felt252-unsafe-arithmetic"
"felt252-overflow"
}

fn description(&self) -> &str {
"Detect felt252 arithmetic overflow/underflow with user-controlled params"
"Detect felt252 arithmetic overflow with user-controlled params"
}

fn confidence(&self) -> Confidence {
Confidence::Medium
}

fn impact(&self) -> Impact {
Impact::Medium
Impact::High
}

fn run(&self, core: &CoreUnit) -> Vec<Result> {
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Felt252Overflow {
// Not tainted by any parameter, but still uses felt252 type
if tainted_by.is_empty() {
let msg = format!(
"The function {} uses the felt252 operation {}, which is not overflow/underflow safe",
"The function {} uses the felt252 operation {}, which is not overflow safe",
&name, libfunc
);
results.push(Result {
Expand All @@ -127,7 +127,7 @@ impl Felt252Overflow {
});
} else {
let msg = format!(
"The function {} uses the felt252 operation {} with the user-controlled parameters: {}, which is not overflow/underflow safe",
"The function {} uses the felt252 operation {} with the user-controlled parameters: {}, which is not overflow safe",
&name,
libfunc,
taints
Expand Down

0 comments on commit c1779da

Please sign in to comment.