mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 21:00:40 +02:00
meson build support
This commit is contained in:
parent
fb85fdec5c
commit
db16a0a853
57 changed files with 1787 additions and 46 deletions
21
src/fe-fuzz/fe-common/core/meson.build
Normal file
21
src/fe-fuzz/fe-common/core/meson.build
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# this file is part of irssi
|
||||
executable('theme-load-fuzz',
|
||||
files(
|
||||
'theme-load.c',
|
||||
'../../../fe-text/module-formats.c',
|
||||
),
|
||||
link_with : [
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libfuzzer_fe_common_core_a,
|
||||
],
|
||||
link_args : [fuzzer_lib],
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : false,
|
||||
install : true,
|
||||
dependencies : dep
|
||||
)
|
||||
|
||||
# noinst_headers = files(
|
||||
# '../../../fe-text/module-formats.h',
|
||||
# )
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
#include <string.h>
|
||||
|
||||
int LLVMFuzzerInitialize(int *argc, char ***argv) {
|
||||
core_register_options();
|
||||
fe_common_core_register_options();
|
||||
char *irssi_argv[] = {*argv[0], "--home", "/tmp/irssi", NULL};
|
||||
int irssi_argc = sizeof(irssi_argv) / sizeof(char *) - 1;
|
||||
core_register_options();
|
||||
fe_common_core_register_options();
|
||||
args_execute(irssi_argc, irssi_argv);
|
||||
core_preinit((*argv)[0]);
|
||||
core_init();
|
||||
|
|
@ -50,6 +50,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) {
|
|||
}
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
THEME_REC *theme;
|
||||
gchar *copy = g_strndup((const gchar *)data, size);
|
||||
|
||||
FILE *fp = fopen("/tmp/irssi/fuzz.theme", "wb");
|
||||
|
|
@ -58,7 +59,7 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
fclose(fp);
|
||||
}
|
||||
|
||||
THEME_REC *theme = theme_load("fuzz");
|
||||
theme = theme_load("fuzz");
|
||||
theme_destroy(theme);
|
||||
|
||||
g_free(copy);
|
||||
|
|
|
|||
3
src/fe-fuzz/fe-common/meson.build
Normal file
3
src/fe-fuzz/fe-common/meson.build
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# this file is part of irssi
|
||||
|
||||
subdir('core')
|
||||
Loading…
Add table
Add a link
Reference in a new issue