From 20d5027ab105ac1c174c7eefc00c7e482e99da7a Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Mon, 12 Feb 2018 12:17:52 +0100 Subject: [PATCH] Main recio: Fixed crashes when a second rec_io_add() followed rec_io_del(). --- ucw/main-rec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ucw/main-rec.c b/ucw/main-rec.c index f13758e3..d3d4a589 100644 --- a/ucw/main-rec.c +++ b/ucw/main-rec.c @@ -58,13 +58,18 @@ rec_io_del(struct main_rec_io *rio) hook_del(&rio->start_read_hook); file_del(&rio->file); + rio->file.read_handler = NULL; + rio->read_started = rio->read_running = 0; + rio->read_avail = rio->read_prev_avail = 0; if (rio->read_buf) { DBG("RIO: Freeing read buffer"); xfree(rio->read_buf); - rio->read_buf = NULL; + rio->read_buf = rio->read_rec_start = NULL; } + rio->file.write_handler = NULL; + rio->write_watermark = 0; struct rio_buffer *b; while ((b = clist_remove_head(&rio->idle_write_buffers)) || (b = clist_remove_head(&rio->busy_write_buffers))) { -- 2.39.5