From 0eadec61543e76bf1664c7f90b31c892c3bf9657 Mon Sep 17 00:00:00 2001 From: Vasilis Kalintiris Date: Tue, 19 Jul 2022 14:43:03 +0300 Subject: Bump --- Makefile.am | 3 ++- cli/cli.c | 40 +++----------------------------------- libnetdata/dictionary/dictionary.c | 4 ++++ libnetdata/dictionary/dictionary.h | 1 + 4 files changed, 10 insertions(+), 38 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1570d922c7..d73ddaa5c9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -986,11 +986,12 @@ netdata_LINK = $(CXXLD) $(CXXFLAGS) $(LDFLAGS) -o $@ sbin_PROGRAMS += netdatacli netdatacli_SOURCES = $(NETDATACLI_FILES) +netdatacli_CFLAGS = $(CFLAGS) -fsanitize=address,fuzzer netdatacli_LDADD = \ $(NETDATA_COMMON_LIBS) \ $(NULL) -netdatacli_LINK = $(CXXLD) $(CXXFLAGS) $(LDFLAGS) -o $@ +netdatacli_LINK = $(CXXLD) $(CXXFLAGS) -fsanitize=address,fuzzer $(LDFLAGS) -o $@ if ENABLE_PLUGIN_APPS plugins_PROGRAMS += apps.plugin diff --git a/cli/cli.c b/cli/cli.c index 229ad2952d..7c754a1558 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -161,41 +161,7 @@ static void connect_cb(uv_connect_t* req, int status) int main(int argc, char **argv) { - int ret, i; - static uv_loop_t* loop; - uv_connect_t req; - - exit_status = -1; /* default status for when there is no command response from server */ - - loop = uv_default_loop(); - - ret = uv_pipe_init(loop, &client_pipe, 1); - if (ret) { - fprintf(stderr, "uv_pipe_init(): %s\n", uv_strerror(ret)); - return exit_status; - } - - command_string_size = 0; - command_string[0] = '\0'; - for (i = 1 ; i < argc ; ++i) { - size_t to_copy; - - to_copy = MIN(strlen(argv[i]), MAX_COMMAND_LENGTH - 1 - command_string_size); - strncpyz(command_string + command_string_size, argv[i], to_copy); - command_string_size += to_copy; - - if (command_string_size < MAX_COMMAND_LENGTH - 1) { - command_string[command_string_size++] = ' '; - } else { - break; - } - } - - uv_pipe_connect(&req, &client_pipe, PIPENAME, connect_cb); - - uv_run(loop, UV_RUN_DEFAULT); - - uv_close((uv_handle_t *)&client_pipe, NULL); - - return exit_status; + UNUSED(argc); + UNUSED(argv); + string_interning_unittests(); } diff --git a/libnetdata/dictionary/dictionary.c b/libnetdata/dictionary/dictionary.c index 122262b9f8..96e1a15f4e 100644 --- a/libnetdata/dictionary/dictionary.c +++ b/libnetdata/dictionary/dictionary.c @@ -2324,3 +2324,7 @@ int dictionary_unittest(size_t entries) { fprintf(stderr, "\n%zu errors found\n", errors); return (int)errors; } + +int string_interning_unittests(void) { + return 0; +} diff --git a/libnetdata/dictionary/dictionary.h b/libnetdata/dictionary/dictionary.h index 6e04fd6ec5..7c7593ae75 100644 --- a/libnetdata/dictionary/dictionary.h +++ b/libnetdata/dictionary/dictionary.h @@ -227,6 +227,7 @@ extern size_t dictionary_stats_walkthroughs(DICTIONARY *dict); extern size_t dictionary_stats_referenced_items(DICTIONARY *dict); extern int dictionary_unittest(size_t entries); +extern int string_interning_unittests(void); // ---------------------------------------------------------------------------- // STRING implementation -- cgit v1.2.3