VirtualBox

source: vbox/trunk/src/libs/libslirp-4.8.0/fuzzing/reproducer.c@ 105529

Last change on this file since 105529 was 105529, checked in by vboxsync, 8 months ago

libs/libslirp: libslirp 4.8.0 fixed exports. bugref:10268

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1#ifdef _WIN32
2/* as defined in sdkddkver.h */
3#ifndef _WIN32_WINNT
4#define _WIN32_WINNT 0x0600 /* Vista */
5#endif
6#include <ws2tcpip.h>
7#endif
8
9#include <glib.h>
10#include <stdlib.h>
11#include "../src/libslirp.h"
12#include "helper.h"
13
14#define MIN_NUMBER_OF_RUNS 1
15#define EXIT_TEST_SKIP 77
16
17extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
18
19int main(int argc, char **argv)
20{
21 int i, j;
22
23 for (i = 1; i < argc; i++) {
24 GError *err = NULL;
25 char *name = argv[i];
26 char *buf;
27 size_t size;
28
29 if (!g_file_get_contents(name, &buf, &size, &err)) {
30 g_warning("Failed to read '%s': %s", name, err->message);
31 g_clear_error(&err);
32 return EXIT_FAILURE;
33 }
34
35 g_print("%s...\n", name);
36 for (j = 0; j < MIN_NUMBER_OF_RUNS; j++) {
37 if (LLVMFuzzerTestOneInput((void *)buf, size) == EXIT_TEST_SKIP) {
38 return EXIT_TEST_SKIP;
39 }
40 }
41 g_free(buf);
42 }
43
44 return EXIT_SUCCESS;
45}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette