Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cwe_checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
cwe_checker
Commits
2a3702fe
Unverified
Commit
2a3702fe
authored
Jan 02, 2024
by
Enkelmann
Committed by
GitHub
Jan 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix clippy warnings introduced in Rust 1.75 (#437)
parent
de827ccc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
13 deletions
+11
-13
bricks.rs
src/cwe_checker_lib/src/abstract_domain/bricks.rs
+3
-5
mod.rs
src/cwe_checker_lib/src/analysis/function_signature/mod.rs
+1
-1
graph.rs
src/cwe_checker_lib/src/analysis/graph.rs
+1
-1
mod.rs
src/cwe_checker_lib/src/analysis/pointer_inference/mod.rs
+1
-1
mod.rs
...cker_lib/src/analysis/stack_alignment_substitution/mod.rs
+1
-1
mod.rs
...hecker_lib/src/analysis/string_abstraction/context/mod.rs
+1
-1
mod.rs
src/cwe_checker_lib/src/analysis/string_abstraction/mod.rs
+1
-1
context.rs
src/cwe_checker_lib/src/checkers/cwe_476/context.rs
+1
-1
cwe_78.rs
src/cwe_checker_lib/src/checkers/cwe_78.rs
+1
-1
No files found.
src/cwe_checker_lib/src/abstract_domain/bricks.rs
View file @
2a3702fe
...
...
@@ -165,15 +165,13 @@ impl BricksDomain {
for
i
in
0
..
long_list
.len
()
{
if
empty_bricks_added
>=
len_diff
{
new_list
.push
(
short_list
.get
(
0
)
.unwrap
()
.clone
());
new_list
.push
(
short_list
[
0
]
.clone
());
short_list
.remove
(
0
);
}
else
if
short_list
.is_empty
()
||
short_list
.get
(
0
)
.unwrap
()
!=
long_list
.get
(
i
)
.unwrap
()
{
}
else
if
short_list
.is_empty
()
||
&
short_list
[
0
]
!=
long_list
.get
(
i
)
.unwrap
()
{
new_list
.push
(
BrickDomain
::
get_empty_brick_domain
());
empty_bricks_added
+=
1
;
}
else
{
new_list
.push
(
short_list
.get
(
0
)
.unwrap
()
.clone
());
new_list
.push
(
short_list
[
0
]
.clone
());
short_list
.remove
(
0
);
}
}
...
...
src/cwe_checker_lib/src/analysis/function_signature/mod.rs
View file @
2a3702fe
...
...
@@ -70,7 +70,7 @@ fn generate_fixpoint_computation<'a>(
// Set the node values for all function entry nodes.
for
node
in
graph
.node_indices
()
{
if
let
Node
::
BlkStart
(
block
,
sub
)
=
graph
[
node
]
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
get
(
0
)
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
first
(
)
{
if
entry_block
.tid
==
block
.tid
{
// The node of a function entry point
let
calling_convention
=
project
...
...
src/cwe_checker_lib/src/analysis/graph.rs
View file @
2a3702fe
...
...
@@ -512,7 +512,7 @@ pub fn get_entry_nodes_of_subs(graph: &Graph) -> HashMap<Tid, NodeIndex> {
let
mut
sub_to_entry_node_map
:
HashMap
<
Tid
,
NodeIndex
>
=
HashMap
::
new
();
for
node
in
graph
.node_indices
()
{
if
let
Node
::
BlkStart
(
block
,
sub
)
=
graph
[
node
]
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
get
(
0
)
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
first
(
)
{
if
block
.tid
==
entry_block
.tid
{
sub_to_entry_node_map
.insert
(
sub
.tid
.clone
(),
node
);
}
...
...
src/cwe_checker_lib/src/analysis/pointer_inference/mod.rs
View file @
2a3702fe
...
...
@@ -305,7 +305,7 @@ impl<'a> PointerInference<'a> {
call
:
(
caller_blk
,
_caller_sub
),
return_
:
_
,
}
=>
{
let
call_tid
=
match
caller_blk
.term.jmps
.
get
(
0
)
{
let
call_tid
=
match
caller_blk
.term.jmps
.
first
(
)
{
Some
(
call
)
=>
&
call
.tid
,
_
=>
continue
,
};
...
...
src/cwe_checker_lib/src/analysis/stack_alignment_substitution/mod.rs
View file @
2a3702fe
...
...
@@ -90,7 +90,7 @@ fn journal_sp_value(
/// Returns the tid of the target of the first Jmp::Branch of the provided block.
fn
get_first_branch_tid
(
blk
:
&
Term
<
Blk
>
)
->
Option
<&
Tid
>
{
if
let
Some
(
jmp
)
=
blk
.term.jmps
.
get
(
0
)
{
if
let
Some
(
jmp
)
=
blk
.term.jmps
.
first
(
)
{
if
let
Jmp
::
Branch
(
jump_to_blk
)
=
&
jmp
.term
{
return
Some
(
jump_to_blk
);
}
...
...
src/cwe_checker_lib/src/analysis/string_abstraction/context/mod.rs
View file @
2a3702fe
...
...
@@ -74,7 +74,7 @@ impl<'a, T: AbstractDomain + HasTop + Eq + From<String> + DomainInsertion> Conte
for
(
node_id
,
node
)
in
pointer_inference_results
.get_graph
()
.node_references
()
{
match
node
{
Node
::
BlkStart
(
block
,
sub
)
=>
{
if
let
Some
(
def
)
=
block
.term.defs
.
get
(
0
)
{
if
let
Some
(
def
)
=
block
.term.defs
.
first
(
)
{
block_start_node_map
.insert
((
def
.tid
.clone
(),
sub
.tid
.clone
()),
node_id
);
block_first_def_set
.insert
((
def
.tid
.clone
(),
sub
.tid
.clone
()));
}
...
...
src/cwe_checker_lib/src/analysis/string_abstraction/mod.rs
View file @
2a3702fe
...
...
@@ -56,7 +56,7 @@ impl<'a, T: AbstractDomain + DomainInsertion + HasTop + Eq + From<String>>
let
mut
sub_to_entry_blocks_map
=
HashMap
::
new
();
for
sub
in
project
.program.term.subs
.values
()
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
get
(
0
)
{
if
let
Some
(
entry_block
)
=
sub
.term.blocks
.
first
(
)
{
sub_to_entry_blocks_map
.insert
(
sub
.tid
.clone
(),
entry_block
.tid
.clone
());
}
}
...
...
src/cwe_checker_lib/src/checkers/cwe_476/context.rs
View file @
2a3702fe
...
...
@@ -70,7 +70,7 @@ impl<'a> Context<'a> {
for
(
node_id
,
node
)
in
graph
.node_references
()
{
match
node
{
Node
::
BlkStart
(
block
,
sub
)
=>
{
if
let
Some
(
def
)
=
block
.term.defs
.
get
(
0
)
{
if
let
Some
(
def
)
=
block
.term.defs
.
first
(
)
{
block_start_node_map
.insert
((
def
.tid
.clone
(),
sub
.tid
.clone
()),
node_id
);
}
}
...
...
src/cwe_checker_lib/src/checkers/cwe_78.rs
View file @
2a3702fe
...
...
@@ -158,7 +158,7 @@ pub fn check_system_call_parameter(
if
let
Some
(
Arg
::
Register
{
expr
:
Expression
::
Var
(
var
),
..
})
=
system_symbol
.parameters
.
get
(
0
)
})
=
system_symbol
.parameters
.
first
(
)
{
if
let
Some
(
value
)
=
source_state
.get_variable_to_pointer_map
()
.get
(
var
)
{
let
contains_string_constant
=
value
.get_absolute_value
()
.is_some
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment