Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libzafl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
libzafl
Commits
58bdb50a
Commit
58bdb50a
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Add comments
parent
4a33feb5
No related branches found
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
src/libzafl.cpp
+5
-2
5 additions, 2 deletions
src/libzafl.cpp
with
5 additions
and
2 deletions
src/libzafl.cpp
+
5
−
2
View file @
58bdb50a
...
...
@@ -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