diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-10-05 00:14:46 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-10-05 00:14:46 +0200 |
commit | ac46f3841f985579712a69207bee5f497a9476f7 (patch) | |
tree | 4a32dec374df5cf72f501e8ea59ed1044f08d796 /nDPIsrvd.c | |
parent | be3f466373645e900c71285dffd153e37455c7e7 (diff) |
Fixed heap overflow on shutdown caused by missing remotes size/used reset.
* introduced with 22a8d04c748ff3e04ca11c5c29b4433c7136f5f5
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r-- | nDPIsrvd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c index bad7c5813..a8ee422b1 100644 --- a/nDPIsrvd.c +++ b/nDPIsrvd.c @@ -232,6 +232,7 @@ static int add_to_additional_write_buffers(struct remote_desc * const remote, "Buffer limit for", "for reached, remote too slow: %u lines", utarray_len(additional_write_buffers)); + logger_nDPIsrvd(remote, "%s", "You can try to increase buffer limits with `-C'."); return -1; } else @@ -719,6 +720,8 @@ static void free_remotes(int epollfd) } nDPIsrvd_free(remotes.desc); remotes.desc = NULL; + remotes.desc_used = 0; + remotes.desc_size = 0; } static int add_event(int epollfd, int events, int fd, void * ptr) @@ -849,7 +852,7 @@ static int nDPIsrvd_parse_options(int argc, char ** argv) "Usage: %s [-l] [-L logfile] [-c path-to-unix-sock] [-d] [-p pidfile]\n" "\t[-s path-to-distributor-unix-socket] [-S distributor-host:port]\n" "\t[-m max-remote-descriptors] [-u user] [-g group]\n" - "\t[-C max-buffered-collector-json-lines] [-D]\n" + "\t[-C max-buffered-json-lines] [-D]\n" "\t[-v] [-h]\n", argv[0]); return 1; @@ -1428,7 +1431,7 @@ static int mainloop(int epollfd) if (fdsi.ssi_signo == SIGINT || fdsi.ssi_signo == SIGTERM || fdsi.ssi_signo == SIGQUIT) { nDPIsrvd_main_thread_shutdown = 1; - break; + continue; } } else |