Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cpp/src/arrow/flight/sql/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ arrow::Result<std::string> CreateStatementQueryTicket(
ticket_statement_query.set_statement_handle(statement_handle);

google::protobuf::Any ticket;
ticket.PackFrom(ticket_statement_query);
// PackFrom returns void for older protobuf versions and [[nodiscard]] bool
// for newer versions, so we explicitly ignore the return value.
(void)ticket.PackFrom(ticket_statement_query);
Comment thread
raulcd marked this conversation as resolved.
Outdated

std::string ticket_string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ ::grpc::Status FlightDataDeserialize(ByteBuffer* buffer,
// Can't use ParseFromCodedStream as this reads the entire
// rest of the stream into the descriptor command field.
std::string buffer;
pb_stream.ReadString(&buffer, length);
if (!pb_stream.ReadString(&buffer, length)) {
return {::grpc::StatusCode::INTERNAL,
"Unable to read FlightDescriptor from protobuf"};
}
if (!pb_descriptor.ParseFromString(buffer)) {
return {::grpc::StatusCode::INTERNAL, "Unable to parse FlightDescriptor"};
}
Expand Down
Loading