Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
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
tci-gateway-module
Grpc
Commits
36cce536
Commit
36cce536
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Delete calls
parent
33fd9fa0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/end2end/fuzzers/api_fuzzer.c
+43
-0
43 additions, 0 deletions
test/core/end2end/fuzzers/api_fuzzer.c
with
43 additions
and
0 deletions
test/core/end2end/fuzzers/api_fuzzer.c
+
43
−
0
View file @
36cce536
...
...
@@ -381,6 +381,33 @@ static call_state *new_call(call_state *sibling, call_state_type type) {
return
c
;
}
static
call_state
*
maybe_delete_call_state
(
call_state
**
active
,
call_state
*
call
)
{
call_state
*
next
=
call
->
next
;
if
(
call
->
call
!=
NULL
)
return
next
;
if
(
call
==
*
active
)
{
*
active
=
call
->
next
;
GPR_ASSERT
(
call
!=
*
active
);
}
call
->
prev
->
next
=
call
->
next
;
call
->
next
->
prev
=
call
->
prev
;
grpc_metadata_array_destroy
(
&
call
->
recv_initial_metadata
);
grpc_metadata_array_destroy
(
&
call
->
recv_trailing_metadata
);
gpr_free
(
call
->
recv_status_details
);
grpc_call_details_destroy
(
&
call
->
call_details
);
gpr_free
(
call
);
return
next
;
}
static
call_state
*
destroy_call
(
call_state
**
active
,
call_state
*
call
)
{
grpc_call_destroy
(
call
->
call
);
call
->
call
=
NULL
;
return
maybe_delete_call_state
(
active
,
call
);
}
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
grpc_test_only_set_metadata_hash_seed
(
0
);
if
(
squelch
)
gpr_set_log_function
(
dont_log
);
...
...
@@ -422,6 +449,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
g_server
=
NULL
;
}
}
call_state
*
s
=
active_call
;
do
{
if
(
s
->
type
!=
PENDING_SERVER
&&
s
->
call
!=
NULL
)
{
s
=
destroy_call
(
&
active_call
,
s
);
}
}
while
(
s
!=
active_call
);
g_now
=
gpr_time_add
(
g_now
,
gpr_time_from_seconds
(
1
,
GPR_TIMESPAN
));
}
...
...
@@ -791,6 +824,16 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
break
;
}
// destroy a call
case
20
:
{
if
(
active_call
->
type
!=
ROOT
&&
active_call
->
type
!=
PENDING_SERVER
&&
active_call
->
call
!=
NULL
)
{
destroy_call
(
&
active_call
,
active_call
);
}
else
{
end
(
&
inp
);
}
break
;
}
}
}
...
...
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