-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e68dd4
commit d11a36b
Showing
9 changed files
with
488 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef HEADER_fd_src_app_fdctl_config_parse_h | ||
#define HEADER_fd_src_app_fdctl_config_parse_h | ||
|
||
#include "config.h" | ||
|
||
FD_PROTOTYPES_BEGIN | ||
|
||
/* fdctl_pod_to_cfg extracts configuration from pod to the typed config | ||
struct. Any recognized keys are removed from pod. Logs errors to | ||
warning log. Returns config on success, NULL on error. | ||
Not thread safe (uses global buffer). */ | ||
|
||
config_t * | ||
fdctl_pod_to_cfg( config_t * config, | ||
uchar * pod ); | ||
|
||
FD_PROTOTYPES_END | ||
|
||
#endif /* HEADER_fd_src_app_fdctl_config_parse_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "config_parse.h" | ||
#include "../../ballet/toml/fd_toml.h" | ||
#include "../../util/fd_util.h" | ||
#include "../../util/sanitize/fd_fuzz.h" | ||
|
||
#include <assert.h> | ||
#include <stdlib.h> | ||
|
||
int | ||
LLVMFuzzerInitialize( int * argc, | ||
char *** argv ) { | ||
putenv( "FD_LOG_BACKTRACE=0" ); | ||
fd_boot( argc, argv ); | ||
atexit( fd_halt ); | ||
fd_log_level_logfile_set( 4 ); | ||
fd_log_level_stderr_set( 4 ); | ||
return 0; | ||
} | ||
|
||
int | ||
LLVMFuzzerTestOneInput( uchar const * data, | ||
ulong size ) { | ||
|
||
static uchar pod_mem[ 1UL<<16 ]; | ||
uchar * pod = fd_pod_join( fd_pod_new( pod_mem, sizeof(pod_mem) ) ); | ||
|
||
static uchar scratch[ 4096 ]; | ||
(void)fd_toml_parse( data, size, pod, scratch, sizeof(scratch) ); | ||
|
||
static config_t config = {0}; | ||
fdctl_pod_to_cfg( &config, pod ); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters