NeoMutt  2025-01-09-117-gace867
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 "mutt.h"
#include "globals.h"
#include "protos.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)
 

Variables

bool StartupComplete = true
 

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t *  data,
size_t  size 
)

Definition at line 25 of file address.c.

26{
28 struct ConfigSet *cs = cs_new(16);
29 NeoMutt = neomutt_new(cs);
30 init_config(cs);
31 OptNoCurses = true;
32 char file[] = "/tmp/mutt-fuzz";
33 FILE *fp = fopen(file, "wb");
34 if (!fp)
35 return -1;
36
37 fwrite(data, 1, size, fp);
38 fclose(fp);
39 fp = fopen(file, "rb");
40 if (!fp)
41 return -1;
42
43 struct Email *e = email_new();
44 struct Envelope *env = mutt_rfc822_read_header(fp, e, 0, 0);
45 mutt_parse_part(fp, e->body);
46 email_free(&e);
47 mutt_env_free(&env);
48 fclose(fp);
50 cs_free(&cs);
51 return 0;
52}
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:77
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:1822
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
Definition: parse.c:1205
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:66
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:19
int(*) log_dispatcher_ MuttLogger)
void init_config(struct ConfigSet *cs)
Initialise the config system.
Definition: mutt_config.c:930
struct NeoMutt * neomutt_new(struct ConfigSet *cs)
Create the main NeoMutt object.
Definition: neomutt.c:50
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
Definition: neomutt.c:86
Container for lots of config items.
Definition: set.h:248
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:43
+ Here is the call graph for this function:

Variable Documentation

◆ StartupComplete

bool StartupComplete = true

Definition at line 14 of file address.c.