diff options
author | kpayson64 <kpayson@google.com> | 2016-07-14 18:10:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-14 18:10:19 -0700 |
commit | 7f6c7798b08afcbf77e675e0bc4e8ce5b6ba580d (patch) | |
tree | c5bfbde99f5868d743f242e4cc144ec5059568b7 | |
parent | 1198da0b5c95b8444e4f282349f5d1f47db76525 (diff) | |
parent | 78aa4580fd02c2a8f1982aa7cf924a2fc5ff6924 (diff) |
Merge pull request #7372 from apolcyn/check_buffer_reader_init_call
Add csharp check to return val of byte_buffer_reader_init
-rw-r--r-- | src/csharp/ext/grpc_csharp_ext.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index c670ea65c7..3d0947c03d 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -253,8 +253,9 @@ GPR_EXPORT intptr_t GPR_CALLTYPE grpcsharp_batch_context_recv_message_length( if (!ctx->recv_message) { return -1; } - /* TODO(issue:#7206): check return value of grpc_byte_buffer_reader_init. */ - grpc_byte_buffer_reader_init(&reader, ctx->recv_message); + + GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message)); + return (intptr_t)grpc_byte_buffer_length(reader.buffer_out); } @@ -268,8 +269,7 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer( gpr_slice slice; size_t offset = 0; - /* TODO(issue:#7206): check return value of grpc_byte_buffer_reader_init. */ - grpc_byte_buffer_reader_init(&reader, ctx->recv_message); + GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message)); while (grpc_byte_buffer_reader_next(&reader, &slice)) { size_t len = GPR_SLICE_LENGTH(slice); |