2 Unix SMB/CIFS implementation.
4 Fuzz driver (AFL style)
6 Copyright (C) Andrew Bartlett 2019
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "lib/util/util_file.h"
26 int main(int argc, char *argv[]) {
31 ret = LLVMFuzzerInitialize(&argc, &argv);
33 printf("LLVMFuzzerInitialize returned %d\n", ret);
39 while (__AFL_LOOP(1000))
41 for (i = 1; i < argc; i++) {
42 uint8_t *buf = (uint8_t *)file_load(argv[i],
46 ret = LLVMFuzzerTestOneInput(buf, size);
49 printf("LLVMFuzzerTestOneInput returned %d on argument %d\n",
57 uint8_t *buf = (uint8_t *)fd_load(0, &size, 0, NULL);
62 ret = LLVMFuzzerTestOneInput(buf, size);