clang-format fuzz

This commit is contained in:
Tatsuhiro Tsujikawa 2022-08-09 21:01:42 +09:00
parent 5164745ff9
commit 8a026e18f5
2 changed files with 3 additions and 2 deletions

View File

@ -62,4 +62,4 @@ clang-format:
test -z $${CLANGFORMAT} && CLANGFORMAT="clang-format"; \
$${CLANGFORMAT} -i lib/*.{c,h} lib/includes/nghttp2/*.h \
src/*.{c,cc,h} src/includes/nghttp2/*.h examples/*.{c,cc} \
tests/*.{c,h} bpf/*.c
tests/*.{c,h} bpf/*.c fuzz/*.cc

View File

@ -76,7 +76,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
/* Initialise a random iv */
nghttp2_settings_entry *iv;
int size_of_iv = data_provider.ConsumeIntegralInRange(1, 10);
iv = (nghttp2_settings_entry*)malloc(sizeof(nghttp2_settings_entry)*size_of_iv);
iv = (nghttp2_settings_entry *)malloc(sizeof(nghttp2_settings_entry) *
size_of_iv);
for (int i = 0; i < size_of_iv; i++) {
iv[i].settings_id = data_provider.ConsumeIntegralInRange(0, 1000);
iv[i].value = data_provider.ConsumeIntegralInRange(0, 1000);