Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zafl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
zafl
Commits
4fce7417
Commit
4fce7417
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Add comments
parent
629356f0
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
libzafl/src/libzafl.cpp
+5
-2
5 additions, 2 deletions
libzafl/src/libzafl.cpp
with
5 additions
and
2 deletions
libzafl/src/libzafl.cpp
+
5
−
2
View file @
4fce7417
...
...
@@ -38,8 +38,8 @@ static int __afl_temp_data;
static
pid_t
__afl_fork_pid
;
static
auto
debug
=
false
;
#define PRINT_ERROR(string) if (debug) {
(void)(
write(2, string, strlen(string))
)
;}
#define PRINT_DEBUG(string) if (debug) {
(void)(
write(1, string, strlen(string))
)
;}
#define PRINT_ERROR(string) if (debug) {
auto x=
write(2, string, strlen(string));}
#define PRINT_DEBUG(string) if (debug) {
auto x=
write(1, string, strlen(string));}
static
void
zafl_setupSharedMemory
();
static
bool
shared_memory_is_setup
=
false
;
...
...
@@ -50,6 +50,8 @@ void __attribute__((constructor)) zafl_initAflForkServer();
void
__attribute__
((
constructor
))
zafl_setupSharedMemory
();
#endif
// always setup a trace map so that an instrumented applicatin will run
// even if not running under AFL
static
void
zafl_setupSharedMemory
()
{
if
(
getenv
(
"ZAFL_DEBUG"
))
debug
=
true
;
...
...
@@ -68,6 +70,7 @@ static void zafl_setupSharedMemory()
zafl_trace_map
=
(
u8
*
)
malloc
(
MAP_SIZE
);
return
;
}
shm_id
=
atoi
(
shm_env_var
);
zafl_trace_map
=
(
u8
*
)
shmat
(
shm_id
,
NULL
,
0
);
if
(
zafl_trace_map
==
(
u8
*
)
-
1
)
{
...
...
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