diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc index 80df2fe1a1f..0cdf97465d0 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.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(self); *max_frame_size = protector->max_protected_frame_size; diff --git a/src/core/tsi/transport_security_grpc.cc b/src/core/tsi/transport_security_grpc.cc index 69591d7343a..cec872690de 100644 --- a/src/core/tsi/transport_security_grpc.cc +++ b/src/core/tsi/transport_security_grpc.cc @@ -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); }