aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2017-02-28 10:23:31 -0800
committerGravatar yang-g <yangg@google.com>2017-02-28 10:23:31 -0800
commit01f1544c3bda51106ef699afd36315a21dbf110f (patch)
tree4deaac4b02a52d681b4eba3e83356856f5e1aa80 /src/cpp
parente434e9e6c01c16618c2acf5975dde9ba16d1ba73 (diff)
Check and act on Dump failure
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/server/health/default_health_check_service.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc
index 46def70e8a..bc98ce79a7 100644
--- a/src/cpp/server/health/default_health_check_service.cc
+++ b/src/cpp/server/health/default_health_check_service.cc
@@ -63,7 +63,9 @@ Status DefaultHealthCheckService::HealthCheckServiceImpl::Check(
ServerContext* context, const ByteBuffer* request, ByteBuffer* response) {
// Decode request.
std::vector<Slice> slices;
- request->Dump(&slices);
+ if (!request->Dump(&slices).ok()) {
+ return Status(StatusCode::INVALID_ARGUMENT, "");
+ }
uint8_t* request_bytes = nullptr;
bool request_bytes_owned = false;
size_t request_size = 0;