Skip to content

Commit

Permalink
Merge pull request grpc#1120 from tatsuhiro-t/fix-crash-with-host-hea…
Browse files Browse the repository at this point in the history
…der-field

Fix server crash if host header field is translated to :authority
  • Loading branch information
dklempner committed Mar 27, 2015
2 parents a8c7c20 + 5c4ff03 commit 32934cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/channel/http_server_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem,
/* translate host to :authority since :authority may be
omitted */
grpc_mdelem *authority = grpc_mdelem_from_metadata_strings(
channeld->mdctx, channeld->authority_key, op->data.metadata->value);
channeld->mdctx, grpc_mdstr_ref(channeld->authority_key),
grpc_mdstr_ref(op->data.metadata->value));
grpc_mdelem_unref(op->data.metadata);
op->data.metadata = authority;
/* pass the event up */
Expand Down

0 comments on commit 32934cf

Please sign in to comment.