Skip to content
Snippets Groups Projects
Commit 1d77059e authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix integer overflow

parent 62f28bfc
No related branches found
No related tags found
No related merge requests found
...@@ -214,7 +214,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< ...@@ -214,7 +214,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
return reader.status(); return reader.status();
} }
::grpc::protobuf::io::CodedInputStream decoder(&reader); ::grpc::protobuf::io::CodedInputStream decoder(&reader);
decoder.SetTotalBytesLimit(UINT32_MAX, UINT32_MAX); decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
if (!msg->ParseFromCodedStream(&decoder)) { if (!msg->ParseFromCodedStream(&decoder)) {
result = Status(StatusCode::INTERNAL, msg->InitializationErrorString()); result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
} }
......
...@@ -160,7 +160,7 @@ class ClientReader final : public ClientReaderInterface<R> { ...@@ -160,7 +160,7 @@ class ClientReader final : public ClientReaderInterface<R> {
} }
bool NextMessageSize(uint32_t* sz) override { bool NextMessageSize(uint32_t* sz) override {
*sz = UINT32_MAX; *sz = INT_MAX;
return true; return true;
} }
...@@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { ...@@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
} }
bool NextMessageSize(uint32_t* sz) override { bool NextMessageSize(uint32_t* sz) override {
*sz = UINT32_MAX; *sz = INT_MAX;
return true; return true;
} }
...@@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface<R> { ...@@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface<R> {
} }
bool NextMessageSize(uint32_t* sz) override { bool NextMessageSize(uint32_t* sz) override {
*sz = UINT32_MAX; *sz = INT_MAX;
return true; return true;
} }
...@@ -474,7 +474,7 @@ class ServerReaderWriterBody final { ...@@ -474,7 +474,7 @@ class ServerReaderWriterBody final {
} }
bool NextMessageSize(uint32_t* sz) { bool NextMessageSize(uint32_t* sz) {
*sz = UINT32_MAX; *sz = INT_MAX;
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment