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
2e8a459d
Unverified
Commit
2e8a459d
authored
2 years ago
by
van Hauser
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1523 from lszekeres/stable
Fix null pointers.
parents
05b1e49b
02db8685
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/aflpp_driver/aflpp_driver.c
+7
-6
7 additions, 6 deletions
utils/aflpp_driver/aflpp_driver.c
with
7 additions
and
6 deletions
utils/aflpp_driver/aflpp_driver.c
+
7
−
6
View file @
2e8a459d
...
@@ -198,7 +198,8 @@ size_t LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) {
...
@@ -198,7 +198,8 @@ size_t LLVMFuzzerMutate(uint8_t *Data, size_t Size, size_t MaxSize) {
}
}
// Execute any files provided as parameters.
// Execute any files provided as parameters.
static
int
ExecuteFilesOnyByOne
(
int
argc
,
char
**
argv
)
{
static
int
ExecuteFilesOnyByOne
(
int
argc
,
char
**
argv
,
int
(
*
callback
)(
const
uint8_t
*
data
,
size_t
size
))
{
unsigned
char
*
buf
=
(
unsigned
char
*
)
malloc
(
MAX_FILE
);
unsigned
char
*
buf
=
(
unsigned
char
*
)
malloc
(
MAX_FILE
);
...
@@ -234,7 +235,7 @@ static int ExecuteFilesOnyByOne(int argc, char **argv) {
...
@@ -234,7 +235,7 @@ static int ExecuteFilesOnyByOne(int argc, char **argv) {
prev_length
=
length
;
prev_length
=
length
;
printf
(
"Reading %zu bytes from %s
\n
"
,
length
,
argv
[
i
]);
printf
(
"Reading %zu bytes from %s
\n
"
,
length
,
argv
[
i
]);
LLVMFuzzerTestOneInput
(
buf
,
length
);
callback
(
buf
,
length
);
printf
(
"Execution successful.
\n
"
);
printf
(
"Execution successful.
\n
"
);
}
}
...
@@ -312,7 +313,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
...
@@ -312,7 +313,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
__afl_sharedmem_fuzzing
=
0
;
__afl_sharedmem_fuzzing
=
0
;
__afl_manual_init
();
__afl_manual_init
();
return
ExecuteFilesOnyByOne
(
argc
,
argv
);
return
ExecuteFilesOnyByOne
(
argc
,
argv
,
callback
);
}
else
if
(
argc
==
2
&&
argv
[
1
][
0
]
==
'-'
)
{
}
else
if
(
argc
==
2
&&
argv
[
1
][
0
]
==
'-'
)
{
...
@@ -328,7 +329,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
...
@@ -328,7 +329,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
if
(
argc
==
2
)
{
__afl_manual_init
();
}
if
(
argc
==
2
)
{
__afl_manual_init
();
}
return
ExecuteFilesOnyByOne
(
argc
,
argv
);
return
ExecuteFilesOnyByOne
(
argc
,
argv
,
callback
);
}
}
...
@@ -338,7 +339,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
...
@@ -338,7 +339,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
// Call LLVMFuzzerTestOneInput here so that coverage caused by initialization
// Call LLVMFuzzerTestOneInput here so that coverage caused by initialization
// on the first execution of LLVMFuzzerTestOneInput is ignored.
// on the first execution of LLVMFuzzerTestOneInput is ignored.
LLVMFuzzerTestOneInput
(
dummy_input
,
4
);
callback
(
dummy_input
,
4
);
__asan_poison_memory_region
(
__afl_fuzz_ptr
,
MAX_FILE
);
__asan_poison_memory_region
(
__afl_fuzz_ptr
,
MAX_FILE
);
size_t
prev_length
=
0
;
size_t
prev_length
=
0
;
...
@@ -375,7 +376,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
...
@@ -375,7 +376,7 @@ int LLVMFuzzerRunDriver(int *argcp, char ***argvp,
while
(
__afl_persistent_loop
(
N
))
{
while
(
__afl_persistent_loop
(
N
))
{
LLVMFuzzerTestOneInput
(
__afl_fuzz_ptr
,
*
__afl_fuzz_len
);
callback
(
__afl_fuzz_ptr
,
*
__afl_fuzz_len
);
}
}
...
...
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