Add nullptr check for max_frame_size.

pull/21505/head
Ashitha Santhosh 5 years ago
parent ec4bfdfa57
commit 0ef0be6541
  1. 2
      src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
  2. 2
      src/core/tsi/transport_security_grpc.cc

@ -235,7 +235,7 @@ static void alts_zero_copy_grpc_protector_destroy(
static tsi_result alts_zero_copy_grpc_protector_max_frame_size(
tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
if (self == nullptr) return TSI_INVALID_ARGUMENT;
if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
alts_zero_copy_grpc_protector* protector =
reinterpret_cast<alts_zero_copy_grpc_protector*>(self);
*max_frame_size = protector->max_protected_frame_size;

@ -67,7 +67,7 @@ void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self) {
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(
tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
if (self == nullptr) return TSI_INVALID_ARGUMENT;
if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
if (self->vtable->max_frame_size == nullptr) return TSI_UNIMPLEMENTED;
return self->vtable->max_frame_size(self, max_frame_size);
}

Loading…
Cancel
Save