diff --git a/lib/nghttp2_frame.c b/lib/nghttp2_frame.c index 077ae1e6..c6318c1e 100644 --- a/lib/nghttp2_frame.c +++ b/lib/nghttp2_frame.c @@ -640,6 +640,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv) return 0; } break; + default: + return 0; } } return 1; diff --git a/tests/nghttp2_frame_test.c b/tests/nghttp2_frame_test.c index 56abc95d..d6495d19 100644 --- a/tests/nghttp2_frame_test.c +++ b/tests/nghttp2_frame_test.c @@ -434,4 +434,9 @@ void test_nghttp2_iv_check(void) CU_ASSERT(nghttp2_iv_check(iv, 2)); iv[1].value = 3; CU_ASSERT(!nghttp2_iv_check(iv, 2)); + + /* Undefined SETTINGS ID */ + iv[1].settings_id = 1000000009; + iv[1].value = 0; + CU_ASSERT(!nghttp2_iv_check(iv, 2)); }