Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Dominik Loidolt
cmp_tool
Commits
e8a3f468
Commit
e8a3f468
authored
4 months ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
debug printf
parent
b7f9474b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/fuzz/fuzz_cmp_tool.c
+8
-5
8 additions, 5 deletions
test/fuzz/fuzz_cmp_tool.c
with
8 additions
and
5 deletions
test/fuzz/fuzz_cmp_tool.c
+
8
−
5
View file @
e8a3f468
...
@@ -151,6 +151,7 @@ err:
...
@@ -151,6 +151,7 @@ err:
static
void
add_argument_with_file
(
char
**
argv
,
int
index
,
const
char
*
flag
,
const
char
*
file
)
static
void
add_argument_with_file
(
char
**
argv
,
int
index
,
const
char
*
flag
,
const
char
*
file
)
{
{
if
(
index
>=
0
)
{
if
(
index
>=
0
)
{
printf
(
"allo arrgv[%d]"
,
index
);
argv
[
index
]
=
FUZZ_malloc
(
FILE_ARG_SIZE
);
argv
[
index
]
=
FUZZ_malloc
(
FILE_ARG_SIZE
);
memcpy
(
argv
[
index
],
flag
,
strlen
(
flag
)
+
1
);
memcpy
(
argv
[
index
],
flag
,
strlen
(
flag
)
+
1
);
strcat
(
argv
[
index
],
file
);
strcat
(
argv
[
index
],
file
);
...
@@ -207,9 +208,12 @@ char **gen_argv(FUZZ_dataProducer_t *producer, int *argc, char *data_file,
...
@@ -207,9 +208,12 @@ char **gen_argv(FUZZ_dataProducer_t *producer, int *argc, char *data_file,
void
free_argv
(
int
argc
,
char
**
argv
)
void
free_argv
(
int
argc
,
char
**
argv
)
{
{
while
(
argc
--
)
{
int
i
;
free
(
argv
[
argc
]);
argv
[
argc
]
=
NULL
;
for
(
i
=
0
;
i
<
argc
;
++
i
)
{
printf
(
"free arrgv[%d]"
,
i
);
free
(
argv
[
i
]);
argv
[
i
]
=
NULL
;
}
}
free
(
argv
);
free
(
argv
);
}
}
...
@@ -265,11 +269,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
...
@@ -265,11 +269,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
{
{
FUZZ_dataProducer_t
*
producer
=
FUZZ_dataProducer_create
(
src
,
size
);
FUZZ_dataProducer_t
*
producer
=
FUZZ_dataProducer_create
(
src
,
size
);
size
=
FUZZ_dataProducer_reserveDataPrefix
(
producer
);
uint32_t
size
32
=
(
uint32_t
)
FUZZ_dataProducer_reserveDataPrefix
(
producer
);
/* Create an array to hold the input arguments */
/* Create an array to hold the input arguments */
int
argc
=
0
;
int
argc
=
0
;
char
**
argv
=
NULL
;
char
**
argv
=
NULL
;
uint32_t
size32
=
(
uint32_t
)
size
;
char
*
data_file
=
get_file
(
producer
,
&
src
,
&
size32
);
char
*
data_file
=
get_file
(
producer
,
&
src
,
&
size32
);
char
*
model_file
=
get_file
(
producer
,
&
src
,
&
size32
);
char
*
model_file
=
get_file
(
producer
,
&
src
,
&
size32
);
char
*
info_file
=
get_file
(
producer
,
&
src
,
&
size32
);
char
*
info_file
=
get_file
(
producer
,
&
src
,
&
size32
);
...
...
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