aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-04-18 14:59:19 -0700
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-04-18 14:59:19 -0700
commit573457bfd966f3d83f99ef9993cca03c3d592384 (patch)
tree3a4b14ecbf7990d58127ddde7eebacf55c926e78 /src
parentfaaeab0869c56dca57e371910478c11bee19f027 (diff)
parent134a6b6ffda49e05643fb736d6914f4b10aa07d8 (diff)
Merge pull request #6203 from ctiller/dictionary
Add a dictionary for fuzzing
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_parser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.c b/src/core/ext/transport/chttp2/transport/hpack_parser.c
index a36d2fc382..93c3e6d8b4 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.c
@@ -638,6 +638,10 @@ static int on_hdr(grpc_chttp2_hpack_parser *p, grpc_mdelem *md,
return 0;
}
}
+ if (p->on_header == NULL) {
+ grpc_mdelem_unref(md);
+ return 0;
+ }
p->on_header(p->on_header_user_data, md);
return 1;
}
@@ -1382,12 +1386,8 @@ static int parse_value_string_with_literal_key(grpc_chttp2_hpack_parser *p,
/* PUBLIC INTERFACE */
-static void on_header_not_set(void *user_data, grpc_mdelem *md) {
- GPR_UNREACHABLE_CODE(return );
-}
-
void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser *p) {
- p->on_header = on_header_not_set;
+ p->on_header = NULL;
p->on_header_user_data = NULL;
p->state = parse_begin;
p->key.str = NULL;
@@ -1455,7 +1455,7 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse(
stream_parsing->received_close = 1;
}
}
- parser->on_header = on_header_not_set;
+ parser->on_header = NULL;
parser->on_header_user_data = NULL;
parser->is_boundary = 0xde;
parser->is_eof = 0xde;