Skip to content

Commit

Permalink
Fix segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
64 committed Feb 17, 2018
1 parent d892d79 commit 9c7cc17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ void client_close_immediate(struct client *client) {
}

static bool is_protocol_correct(struct client *client) {
return strcmp("h2", s2n_get_application_protocol(client->tls)) == 0;
const char *proto = s2n_get_application_protocol(client->tls);
if (proto == NULL)
return false;
return strcmp("h2", proto) == 0;
}

static void initiate_graceful_close(struct client *client) {
Expand Down

0 comments on commit 9c7cc17

Please sign in to comment.