Zero out md_index when linked_mdelem is created to fix bug

reviewable/pr16488/r2
Hope Casey-Allen 6 years ago
parent d75415ccfd
commit 4099c40d9f
  1. 1
      src/core/lib/surface/call.cc

@ -954,6 +954,7 @@ static int prepare_application_metadata(grpc_call* call, int count,
const grpc_metadata* md = const grpc_metadata* md =
get_md_elem(metadata, additional_metadata, i, count); get_md_elem(metadata, additional_metadata, i, count);
grpc_linked_mdelem* l = linked_from_md(md); grpc_linked_mdelem* l = linked_from_md(md);
l->md_index = 0;
GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data)); GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data));
if (!GRPC_LOG_IF_ERROR("validate_metadata", if (!GRPC_LOG_IF_ERROR("validate_metadata",
grpc_validate_header_key_is_legal(md->key))) { grpc_validate_header_key_is_legal(md->key))) {

Loading…
Cancel
Save