MCPcopy Create free account
hub / github.com/ElementsProject/lightning / main

Function main

tests/fuzz/libfuzz.c:157–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157int main(int argc, char *argv[])
158{
159 DIR *d;
160 struct dirent *di;
161 int verbose_flag;
162
163 common_setup(argv[0]);
164 assert(chdir("tests/fuzz/corpora") == 0);
165 assert(chdir(path_basename(tmpctx, argv[0])) == 0);
166
167 init(&argc, &argv);
168 verbose_flag = find_opt(argv, "-v");
169 d = opendir(".");
170 while ((di = readdir(d)) != NULL) {
171 u8 *contents;
172 if (streq(di->d_name, ".") || streq(di->d_name, ".."))
173 continue;
174 /* If you specify options other than -v, they're test names */
175 if (argv[verbose_flag + 1] && !find_opt(argv, di->d_name))
176 continue;
177 if (verbose_flag)
178 printf("%s\n", di->d_name);
179 contents = grab_file_raw(tmpctx, di->d_name);
180 if (!contents)
181 err(1, "Could not read %s", di->d_name);
182 run(contents, tal_bytelen(contents));
183 }
184 closedir(d);
185 common_shutdown();
186}
187
188/* We never call any functions which might call these */
189size_t LLVMFuzzerMutate(uint8_t *data, size_t size, size_t max_size);

Callers

nothing calls this directly

Calls 9

common_setupFunction · 0.85
path_basenameFunction · 0.85
grab_file_rawFunction · 0.85
errFunction · 0.85
tal_bytelenFunction · 0.85
common_shutdownFunction · 0.85
initFunction · 0.70
find_optFunction · 0.70
runFunction · 0.70

Tested by

no test coverage detected