diff options
author | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-13 13:36:42 +0200 |
---|---|---|
committer | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-29 15:48:22 +0200 |
commit | 0be142b8c9934c3cce43abca755eca1f22144320 (patch) | |
tree | 630bd9e324bfc863832fc1818721c2d5d95fa9d3 | |
parent | 1e0b3880f945bb8c3a37997f32ea1c585a79491e (diff) |
disarm timer on release
This is a repeat timer, if not stopped, it will run again triggering UAF.
-rw-r--r-- | src/core.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -40,6 +40,7 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli) inet_ntoa(cli->addr.sin_addr), htons(cli->addr.sin_port)); list_del(&cli->list); + ev_timer_stop(loop, &cli->timer); ev_io_stop(loop, &cli->io); shutdown(cli->io.fd, SHUT_RDWR); close(cli->io.fd); @@ -196,7 +197,6 @@ shutdown: if (cli->size > FILE_SIZE_THRESHOLD) tip_client_redirect_create(cli); close: - ev_timer_stop(loop, &cli->timer); tip_client_release(loop, cli); } @@ -300,7 +300,6 @@ static void tip_client_write_cb(struct ev_loop *loop, struct ev_io *io, int even } return; close: - ev_timer_stop(loop, &cli->timer); tip_client_release(loop, cli); } |