Fix integer overflow

pull/9404/head
Craig Tiller 8 years ago
parent 62f28bfcf0
commit 1d77059e4b
  1. 2
      include/grpc++/impl/codegen/proto_utils.h
  2. 8
      include/grpc++/impl/codegen/sync_stream.h

@ -214,7 +214,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
return reader.status();
}
::grpc::protobuf::io::CodedInputStream decoder(&reader);
decoder.SetTotalBytesLimit(UINT32_MAX, UINT32_MAX);
decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
if (!msg->ParseFromCodedStream(&decoder)) {
result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
}

@ -160,7 +160,7 @@ class ClientReader final : public ClientReaderInterface<R> {
}
bool NextMessageSize(uint32_t* sz) override {
*sz = UINT32_MAX;
*sz = INT_MAX;
return true;
}
@ -310,7 +310,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
}
bool NextMessageSize(uint32_t* sz) override {
*sz = UINT32_MAX;
*sz = INT_MAX;
return true;
}
@ -382,7 +382,7 @@ class ServerReader final : public ServerReaderInterface<R> {
}
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;
}

Loading…
Cancel
Save