diff options
author | kpayson64 <kpayson@google.com> | 2016-08-02 10:03:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-02 10:03:59 -0700 |
commit | fcccb5aca51c36841a229eba2884f7c67468143f (patch) | |
tree | 076935396caa23afaccc1d79118d1790f855f4db /src/core/lib/surface/call.c | |
parent | 1e3fdbe7fd7831fe31b05a3da8044872564c4351 (diff) | |
parent | e60003d4f902b7b819cff6ae88c41bcd96b55b81 (diff) |
Merge pull request #7603 from vitalybuka/stack-use-after-scope
Fix stack-use-after-scope in call.c
Diffstat (limited to 'src/core/lib/surface/call.c')
-rw-r--r-- | src/core/lib/surface/call.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 70c94791f8..59295f47f0 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1367,6 +1367,9 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, int num_completion_callbacks_needed = 1; grpc_call_error error = GRPC_CALL_OK; + // sent_initial_metadata guards against variable reuse. + grpc_metadata compression_md; + GPR_TIMER_BEGIN("grpc_call_start_batch", 0); GRPC_CALL_LOG_BATCH(GPR_INFO, call, ops, nops, notify_tag); @@ -1412,8 +1415,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, goto done_with_error; } /* process compression level */ - grpc_metadata compression_md; - memset(&compression_md, 0, sizeof(grpc_metadata)); + memset(&compression_md, 0, sizeof(compression_md)); size_t additional_metadata_count = 0; grpc_compression_level effective_compression_level; bool level_set = false; |