mirror of
https://github.com/tmux/tmux.git
synced 2025-01-06 07:48:48 +00:00
Fuzzer needs some other bits it seems.
This commit is contained in:
parent
c1be1b351d
commit
21ce1e04fe
@ -26,7 +26,7 @@
|
||||
struct event_base *libevent;
|
||||
|
||||
int
|
||||
LLVMFuzzerTestOneInput(const unsigned char *data, size_t size)
|
||||
LLVMFuzzerTestOneInput(const u_char *data, size_t size)
|
||||
{
|
||||
struct bufferevent *vpty[2];
|
||||
struct window *w;
|
||||
@ -46,7 +46,12 @@ LLVMFuzzerTestOneInput(const unsigned char *data, size_t size)
|
||||
wp->ictx = input_init(wp, vpty[0], NULL);
|
||||
window_add_ref(w, __func__);
|
||||
|
||||
input_parse_buffer(wp, (u_char*) data, size);
|
||||
wp->fd = open("/dev/null", O_WRONLY);
|
||||
if (wp->fd == -1)
|
||||
errx(1, "open(\"/dev/null\") failed");
|
||||
wp->event = bufferevent_new(wp->fd, NULL, NULL, NULL, NULL);
|
||||
|
||||
input_parse_buffer(wp, (u_char *)data, size);
|
||||
while (cmdq_next(NULL) != 0)
|
||||
;
|
||||
error = event_base_loop(libevent, EVLOOP_NONBLOCK);
|
||||
@ -84,6 +89,7 @@ LLVMFuzzerInitialize(__unused int *argc, __unused char ***argv)
|
||||
options_set_number(global_w_options, "monitor-bell", 0);
|
||||
options_set_number(global_w_options, "allow-rename", 1);
|
||||
options_set_number(global_options, "set-clipboard", 2);
|
||||
socket_path = xstrdup("dummy");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user