Skip to content

Commit

Permalink
Limit acceptance tests to PRs to the master branch (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkelmann authored Aug 28, 2023
1 parent f873345 commit 08b72f6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- master
pull_request:
branches:
- master

env:
CARGO_TERM_COLOR: always
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</p>

# cwe_checker #
![Acceptance tests](https://github.com/fkie-cad/cwe_checker/actions/workflows/acceptance-tests.yml/badge.svg)
![Unit tests](https://github.com/fkie-cad/cwe_checker/actions/workflows/unit-tests.yml/badge.svg)
![Acceptance tests](https://github.com/fkie-cad/cwe_checker/actions/workflows/acceptance-tests.yml/badge.svg?branch=master)
![Unit tests](https://github.com/fkie-cad/cwe_checker/actions/workflows/unit-tests.yml/badge.svg?branch=master)
![Docker-Pulls](https://img.shields.io/docker/pulls/fkiecad/cwe_checker.svg)
[![Documentation](https://img.shields.io/badge/doc-stable-green.svg)](https://fkie-cad.github.io/cwe_checker/index.html)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'a, T: AbstractDomain + DomainInsertion + HasTop + Eq + From<String>> Conte

/// Regex that filters format specifier from a format string.
pub fn re_format_specifier() -> Regex {
Regex::new(r#"%\d{0,2}([c,C,d,i,o,u,x,X,e,E,f,F,g,G,a,A,n,p,s,S]|hi|hd|hu|li|ld|lu|lli|lld|llu|lf|lg|le|la|lF|lG|lE|lA|Lf|Lg|Le|La|LF|LG|LE|LA)"#).expect("No valid regex!")
Regex::new(r"%\d{0,2}([c,C,d,i,o,u,x,X,e,E,f,F,g,G,a,A,n,p,s,S]|hi|hd|hu|li|ld|lu|lli|lld|llu|lf|lg|le|la|lF|lG|lE|lA|Lf|Lg|Le|La|LF|LG|LE|LA)").expect("No valid regex!")
}

/// Merges domains from multiple pointer targets. The merged domain serves as input to a format string.
Expand Down
2 changes: 1 addition & 1 deletion src/cwe_checker_lib/src/checkers/cwe_119/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn collect_tids_for_cwe_warning(
&caller_tid,
state.stack_id.get_tid(),
);
tids.extend(call_sequence_tids.into_iter());
tids.extend(call_sequence_tids);
}
// Build a string out of the TID list
tids.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/cwe_checker_lib/src/utils/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn parse_format_string_parameters(
// - `[\.]?\d*` matches the precision parameter (for printf-like functions)
// - `[cCdiouxXeEfFgGaAnpsS]` matches a format specifier without length parameter.
// - `hi|hd|hu|li|ld|lu|lli|lld|llu|lf|lg|le|la|lF|lG|lE|lA|Lf|Lg|Le|La|LF|LG|LE|LA` matches format specifiers with length parameter.
let re = Regex::new(r#"%[+\-#0]{0,1}\d*[\.]?\d*([cCdiouxXeEfFgGaAnpsS]|hi|hd|hu|li|ld|lu|lli|lld|llu|lf|lg|le|la|lF|lG|lE|lA|Lf|Lg|Le|La|LF|LG|LE|LA)"#)
let re = Regex::new(r"%[+\-#0]{0,1}\d*[\.]?\d*([cCdiouxXeEfFgGaAnpsS]|hi|hd|hu|li|ld|lu|lli|lld|llu|lf|lg|le|la|lF|lG|lE|lA|Lf|Lg|Le|La|LF|LG|LE|LA)")
.expect("No valid regex!");

let datatype_map: Vec<(Datatype, ByteSize)> = re
Expand Down
2 changes: 1 addition & 1 deletion src/cwe_checker_lib/src/utils/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl LogThread {
let logs = logs_with_address
.values()
.cloned()
.chain(general_logs.into_iter())
.chain(general_logs)
.collect();
let cwes = collected_cwes.into_values().collect();
(logs, cwes)
Expand Down

0 comments on commit 08b72f6

Please sign in to comment.