From 2a0f1d7636a9fd941fbb04f52fe9c23b3263406a Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Wed, 7 Apr 2021 11:05:05 +0200 Subject: [PATCH] fix fe-fuzz --- src/fe-fuzz/server.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fe-fuzz/server.c b/src/fe-fuzz/server.c index a444494d..a2ffb9e9 100644 --- a/src/fe-fuzz/server.c +++ b/src/fe-fuzz/server.c @@ -177,12 +177,23 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { for (; *lines != NULL; lines++) { gchar *prefixedLine; + int disconnected; if (prefixedChoice) { prefixedLine = g_strdup_printf(":user %s\n", *lines); } else { prefixedLine = g_strdup_printf("%s\n", *lines); } + server_ref(server); signal_emit("server incoming", 2, server, prefixedLine); + disconnected = server->disconnected; + if (disconnected) { + server_connect_unref(server->connrec); + } + server_unref(server); + if (disconnected) { + /* reconnect */ + test_server(); + } g_free(prefixedLine); }