diff options
author | kpayson64 <kpayson@google.com> | 2016-08-15 16:17:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-15 16:17:18 -0700 |
commit | a150352090ec2b5b2c385e3394f5392d61c28aee (patch) | |
tree | 2ab676bb3cd5cc9df93829274e708442769153f7 /src/csharp | |
parent | bcc0d8870a34f79d0b488b414644045aba0e83c4 (diff) | |
parent | 2222047f4588c03abbbd0554eb2b938ee44d0501 (diff) |
Merge pull request #7492 from apolcyn/return_val_check
Add csharp check to return val of byte_buffer_reader_init
Diffstat (limited to 'src/csharp')
-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); |