Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AFLplusplus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ulf Kargén
AFLplusplus
Commits
a3b56e72
Commit
a3b56e72
authored
2 years ago
by
Dominik Maier
Browse files
Options
Downloads
Patches
Plain Diff
rust custom mutator: mark external fns unsafe
parent
57e74087
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
custom_mutators/rust/custom_mutator/src/lib.rs
+5
-6
5 additions, 6 deletions
custom_mutators/rust/custom_mutator/src/lib.rs
custom_mutators/rust/example_lain/Cargo.toml
+1
-1
1 addition, 1 deletion
custom_mutators/rust/example_lain/Cargo.toml
with
6 additions
and
7 deletions
custom_mutators/rust/custom_mutator/src/lib.rs
+
5
−
6
View file @
a3b56e72
...
@@ -247,7 +247,7 @@ pub mod wrappers {
...
@@ -247,7 +247,7 @@ pub mod wrappers {
}
}
/// Internal function used in the macro
/// Internal function used in the macro
pub
fn
afl_custom_queue_new_entry_
<
M
:
RawCustomMutator
>
(
pub
unsafe
fn
afl_custom_queue_new_entry_
<
M
:
RawCustomMutator
>
(
data
:
*
mut
c_void
,
data
:
*
mut
c_void
,
filename_new_queue
:
*
const
c_char
,
filename_new_queue
:
*
const
c_char
,
filename_orig_queue
:
*
const
c_char
,
filename_orig_queue
:
*
const
c_char
,
...
@@ -337,7 +337,7 @@ pub mod wrappers {
...
@@ -337,7 +337,7 @@ pub mod wrappers {
}
}
/// Internal function used in the macro
/// Internal function used in the macro
pub
fn
afl_custom_queue_get_
<
M
:
RawCustomMutator
>
(
pub
unsafe
fn
afl_custom_queue_get_
<
M
:
RawCustomMutator
>
(
data
:
*
mut
c_void
,
data
:
*
mut
c_void
,
filename
:
*
const
c_char
,
filename
:
*
const
c_char
,
)
->
u8
{
)
->
u8
{
...
@@ -441,7 +441,7 @@ macro_rules! export_mutator {
...
@@ -441,7 +441,7 @@ macro_rules! export_mutator {
}
}
#[no_mangle]
#[no_mangle]
pub
extern
"C"
fn
afl_custom_queue_new_entry
(
pub
unsafe
extern
"C"
fn
afl_custom_queue_new_entry
(
data
:
*
mut
::
std
::
os
::
raw
::
c_void
,
data
:
*
mut
::
std
::
os
::
raw
::
c_void
,
filename_new_queue
:
*
const
::
std
::
os
::
raw
::
c_char
,
filename_new_queue
:
*
const
::
std
::
os
::
raw
::
c_char
,
filename_orig_queue
:
*
const
::
std
::
os
::
raw
::
c_char
,
filename_orig_queue
:
*
const
::
std
::
os
::
raw
::
c_char
,
...
@@ -454,7 +454,7 @@ macro_rules! export_mutator {
...
@@ -454,7 +454,7 @@ macro_rules! export_mutator {
}
}
#[no_mangle]
#[no_mangle]
pub
extern
"C"
fn
afl_custom_queue_get
(
pub
unsafe
extern
"C"
fn
afl_custom_queue_get
(
data
:
*
mut
::
std
::
os
::
raw
::
c_void
,
data
:
*
mut
::
std
::
os
::
raw
::
c_void
,
filename
:
*
const
::
std
::
os
::
raw
::
c_char
,
filename
:
*
const
::
std
::
os
::
raw
::
c_char
,
)
->
u8
{
)
->
u8
{
...
@@ -757,8 +757,7 @@ mod truncate_test {
...
@@ -757,8 +757,7 @@ mod truncate_test {
let
actual_output
=
truncate_str_unicode_safe
(
input
,
*
max_len
);
let
actual_output
=
truncate_str_unicode_safe
(
input
,
*
max_len
);
assert_eq!
(
assert_eq!
(
&
actual_output
,
expected_output
,
&
actual_output
,
expected_output
,
"{:#?} truncated to {} bytes should be {:#?}, but is {:#?}"
,
"{input:#?} truncated to {max_len} bytes should be {expected_output:#?}, but is {actual_output:#?}"
input
,
max_len
,
expected_output
,
actual_output
);
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
custom_mutators/rust/example_lain/Cargo.toml
+
1
−
1
View file @
a3b56e72
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
name
=
"example_lain"
name
=
"example_lain"
version
=
"0.1.0"
version
=
"0.1.0"
authors
=
[
"Julius Hohnerlein <julihoh@users.noreply.github.com>"
]
authors
=
[
"Julius Hohnerlein <julihoh@users.noreply.github.com>"
]
edition
=
"201
8
"
edition
=
"20
2
1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment