36RCSID(
"$Id: fd06ebec54f8385f3879b36b5fb9d4830988f2cb $")
38#include <freeradius-devel/fuzzer/common.h>
39#include <freeradius-devel/server/base.h>
40#include <freeradius-devel/server/request.h>
41#include <freeradius-devel/server/tmpl.h>
42#include <freeradius-devel/unlang/base.h>
43#include <freeradius-devel/unlang/xlat.h>
81#define POISON_START 64
97 if (size < 2)
return 0;
98 if (size > 4096)
return 0;
100 mode =
data[0] & 0x03;
114 if (!raw_fmt)
goto done;
116 if (fmt_len) memcpy(
fmt,
data + 1, fmt_len);
130 .allow_unresolved =
false,
131 .allow_unknown =
false,
132 .allow_wildcard =
true,
170 .allow_unresolved =
false,
190 char print_buf[1024];
static int const char * fmt
int fuzzer_common_init(int *argc, char ***argv, bool load_proto)
Perform all bootstrapping for the fuzzer.
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
int LLVMFuzzerInitialize(int *argc, char ***argv)
int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
int unlang_global_init(void)
#define ASAN_POISON_MEMORY_REGION(_start, _size)
#define ASAN_UNPOISON_MEMORY_REGION(_start, _size)
fr_dict_attr_t const * request_attr_request
int request_global_init(void)
#define FR_SBUFF_IN(_start, _len_or_end)
#define FR_SBUFF_OUT(_start, _len_or_end)
int tmpl_global_init(void)
fr_dict_t const * dict_def
Alternative default dictionary to use if vpt->rules->dict_def is NULL.
tmpl_attr_rules_t attr
Rules/data for parsing attribute references.
struct tmpl_res_rules_s tmpl_res_rules_t
struct tmpl_rules_s tmpl_rules_t
struct tmpl_attr_rules_s tmpl_attr_rules_t
Optional arguments passed to vp_tmpl functions.
fr_dict_t const * dict_def
Default dictionary to use with unqualified attribute references.
static TALLOC_CTX * talloc_init_const(char const *name)
Allocate a top level chunk with a constant name.
tmpl_res_rules_t const * tr_rules
tmpl resolution rules.
fr_slen_t xlat_tokenize_condition(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules))
fr_slen_t xlat_print(fr_sbuff_t *in, xlat_exp_head_t const *node, fr_sbuff_escape_rules_t const *e_rules)
Reconstitute an xlat expression from its constituent nodes.
fr_slen_t xlat_tokenize(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules)
Tokenize an xlat expansion.
int xlat_resolve(xlat_exp_head_t *head, xlat_res_rules_t const *xr_rules)
Walk over an xlat tree recursively, resolving any unresolved functions or references.
fr_slen_t xlat_tokenize_argv(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in, xlat_arg_parser_t const *xlat_args, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules, bool spaces))
Tokenize an xlat expansion into a series of XLAT_TYPE_CHILD arguments.
fr_slen_t xlat_tokenize_expression(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules))
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
void fr_strerror_clear(void)
Clears all pending messages from the talloc pools.
int fr_check_lib_magic(uint64_t magic)
Check if the application linking to the library has the correct magic number.
#define RADIUSD_MAGIC_NUMBER