Error if undefined SETTINGS ID is detected in nghttp2_iv_check

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-11 16:53:08 +09:00
parent 39fe7a5cfa
commit cf0b880b15
2 changed files with 7 additions and 0 deletions

View File

@ -640,6 +640,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv)
return 0;
}
break;
default:
return 0;
}
}
return 1;

View File

@ -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));
}