From 1d77059e4b1ec17c704acfc876e321cc33bff99d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 19 Jan 2017 11:44:42 -0800 Subject: Fix integer overflow --- include/grpc++/impl/codegen/proto_utils.h | 2 +- include/grpc++/impl/codegen/sync_stream.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h index acaa48afee..2123b62ed9 100644 --- a/include/grpc++/impl/codegen/proto_utils.h +++ b/include/grpc++/impl/codegen/proto_utils.h @@ -214,7 +214,7 @@ class SerializationTraitsParseFromCodedStream(&decoder)) { result = Status(StatusCode::INTERNAL, msg->InitializationErrorString()); } diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index e0f9ba7701..1f7708bab9 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -160,7 +160,7 @@ class ClientReader final : public ClientReaderInterface { } bool NextMessageSize(uint32_t* sz) override { - *sz = UINT32_MAX; + *sz = INT_MAX; return true; } @@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface { } bool NextMessageSize(uint32_t* sz) override { - *sz = UINT32_MAX; + *sz = INT_MAX; return true; } @@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface { } bool NextMessageSize(uint32_t* sz) override { - *sz = UINT32_MAX; + *sz = INT_MAX; return true; } @@ -474,7 +474,7 @@ class ServerReaderWriterBody final { } bool NextMessageSize(uint32_t* sz) { - *sz = UINT32_MAX; + *sz = INT_MAX; return true; } -- cgit v1.2.3