aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-21 15:16:26 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-21 15:16:26 -0800
commit0c3fdad486d2fb23e60e1a3bf261b1846c877148 (patch)
treefe5230b0d906d540c66871bee8eeb00fb0084aca /tools
parentf28ca8ea22ec19d490129e49967024110bb3c463 (diff)
Fix hpack fuzzer
Diffstat (limited to 'tools')
-rwxr-xr-xtools/codegen/core/gen_static_metadata.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py
index 0374cf75a1..4703708aaa 100755
--- a/tools/codegen/core/gen_static_metadata.py
+++ b/tools/codegen/core/gen_static_metadata.py
@@ -461,7 +461,7 @@ print >>C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {'
print >>C, ' if (a == -1 || b == -1) return GRPC_MDNULL;'
print >>C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs)
print >>C, ' uint32_t h = elems_phash(k);'
-print >>C, ' return elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;'
+print >>C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;'
print >>C, '}'
print >>C