mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-04-23 23:27:06 -04:00
DHCP fuzzer: add comments
This commit is contained in:
parent
0123fb3f7d
commit
519fbf338b
1 changed files with 7 additions and 0 deletions
|
|
@ -6,21 +6,28 @@ int LLVMFuzzerInitialize(int *argc, char ***argv)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
{
|
||||
struct gc_arena gc;
|
||||
struct buffer ipbuf;
|
||||
in_addr_t ret;
|
||||
|
||||
/* Encapsulate raw input buffer in a struct buffer */
|
||||
ipbuf = alloc_buf(size);
|
||||
if ( buf_write(&ipbuf, data, size) == false ) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Change internal buffer state to test whether dhcp_extract_router_msg
|
||||
* depends on a certain state */
|
||||
fuzzer_alter_buffer(&ipbuf);
|
||||
|
||||
ret = dhcp_extract_router_msg(&ipbuf);
|
||||
#ifdef MSAN
|
||||
test_undefined_memory(&ret, sizeof(ret));
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
free_buf(&ipbuf);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue