php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
fuzzer-execute.c
Go to the documentation of this file.
1
/*
2
+----------------------------------------------------------------------+
3
| Copyright (c) The PHP Group |
4
+----------------------------------------------------------------------+
5
| This source file is subject to version 3.01 of the PHP license, |
6
| that is bundled with this package in the file LICENSE, and is |
7
| available through the world-wide-web at the following url: |
8
| https://www.php.net/license/3_01.txt |
9
| If you did not receive a copy of the PHP license and are unable to |
10
| obtain it through the world-wide-web, please send a note to |
11
| license@php.net so we can mail you a copy immediately. |
12
+----------------------------------------------------------------------+
13
| Authors: Nikita Popov <nikic@php.net> |
14
+----------------------------------------------------------------------+
15
*/
16
17
#include "
fuzzer-execute-common.h
"
18
19
int
LLVMFuzzerTestOneInput
(
const
uint8_t *Data,
size_t
Size) {
20
if
(Size >
MAX_SIZE
) {
21
/* Large inputs have a large impact on fuzzer performance,
22
* but are unlikely to be necessary to reach new codepaths. */
23
return
0;
24
}
25
26
steps_left =
MAX_STEPS
;
27
fuzzer_do_request_from_buffer
(
28
FILE_NAME
, (
const
char
*) Data, Size,
/* execute */
1,
/* before_shutdown */
NULL
);
29
30
return
0;
31
}
32
33
int
LLVMFuzzerInitialize
(
int
*argc,
char
***argv) {
34
fuzzer_init_php_for_execute(
NULL
);
35
return
0;
36
}
FILE_NAME
#define FILE_NAME
Definition
file.h:267
fuzzer-execute-common.h
MAX_SIZE
#define MAX_SIZE
Definition
fuzzer-execute-common.h:29
MAX_STEPS
#define MAX_STEPS
Definition
fuzzer-execute-common.h:28
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
Definition
fuzzer-execute.c:19
LLVMFuzzerInitialize
int LLVMFuzzerInitialize(int *argc, char ***argv)
Definition
fuzzer-execute.c:33
fuzzer_do_request_from_buffer
int fuzzer_do_request_from_buffer(char *filename, const char *data, size_t data_len, bool execute, void(*before_shutdown)(void))
Definition
fuzzer-sapi.c:240
NULL
#define NULL
Definition
gdcache.h:45
sapi
fuzzer
fuzzer-execute.c
Generated on Sat Aug 23 2025 01:46:13 for php-internal-docs by
1.13.2