NeoMutt  2024-04-25-1-g3de005
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
address.c File Reference
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "globals.h"
#include "init.h"
+ Include dependency graph for address.c:

Go to the source code of this file.

Functions

static int log_disp_null (time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
 Discard log lines - Implements log_dispatcher_t -.
 
int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
 

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t *  data,
size_t  size 
)

Definition at line 22 of file address.c.

23{
25 struct ConfigSet *cs = cs_new(16);
26 NeoMutt = neomutt_new(cs);
27 init_config(cs);
28 OptNoCurses = true;
29 char file[] = "/tmp/mutt-fuzz";
30 FILE *fp = fopen(file, "wb");
31 if (!fp)
32 return -1;
33
34 fwrite(data, 1, size, fp);
35 fclose(fp);
36 fp = fopen(file, "rb");
37 if (!fp)
38 return -1;
39
40 struct Email *e = email_new();
41 struct Envelope *env = mutt_rfc822_read_header(fp, e, 0, 0);
42 mutt_parse_part(fp, e->body);
43 email_free(&e);
44 mutt_env_free(&env);
45 fclose(fp);
47 cs_free(&cs);
48 return 0;
49}
void cs_free(struct ConfigSet **ptr)
Free a Config Set.
Definition: set.c:141
struct ConfigSet * cs_new(size_t size)
Create a new Config Set.
Definition: set.c:127
struct Email * email_new(void)
Create a new Email.
Definition: email.c:80
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:46
void mutt_parse_part(FILE *fp, struct Body *b)
Parse a MIME part.
Definition: parse.c:1817
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
Definition: parse.c:1200
void mutt_env_free(struct Envelope **ptr)
Free an Envelope.
Definition: envelope.c:126
bool OptNoCurses
(pseudo) when sending in batch mode
Definition: globals.c:72
static int log_disp_null(time_t stamp, const char *file, int line, const char *function, enum LogLevel level, const char *format,...)
Discard log lines - Implements log_dispatcher_t -.
Definition: address.c:16
void init_config(struct ConfigSet *cs)
Initialise the config system.
Definition: mutt_config.c:1055
int(*) log_dispatcher_ MuttLogger)
struct NeoMutt * neomutt_new(struct ConfigSet *cs)
Create the main NeoMutt object.
Definition: neomutt.c:45
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
Definition: neomutt.c:81
Container for lots of config items.
Definition: set.h:252
The envelope/body of an email.
Definition: email.h:39
struct Body * body
List of MIME parts.
Definition: email.h:69
The header of an Email.
Definition: envelope.h:57
Container for Accounts, Notifications.
Definition: neomutt.h:41
+ Here is the call graph for this function: