tests: make entry_handler static in ini_config test
[lttng-tools.git] / tests / unit / ini_config / ini_config.c
index e9710275b39bb56e3b5a162228ffd333207048f7..e759faf786eaaf69b823ac333f7ce601e3f600e6 100644 (file)
@@ -19,6 +19,7 @@
 #include <common/config/session-config.h>
 #include <common/utils.h>
 #include <string.h>
+#include <lttng/constant.h>
 
 struct state {
        int section_1;
@@ -33,8 +34,7 @@ int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 0;
 int lttng_opt_mi;
 
-int entry_handler(const struct config_entry *entry,
-               struct state *state)
+static int entry_handler(const struct config_entry *entry, struct state *state)
 {
        int ret = 0;
 
@@ -81,6 +81,11 @@ int main(int argc, char **argv)
                goto end;
        }
 
+       if (strlen(argv[1]) >= LTTNG_PATH_MAX) {
+               diag("The provided path exceeds the maximal permitted length of %i bytes",
+                               LTTNG_PATH_MAX);
+               goto end;
+       }
        path = utils_expand_path(argv[1]);
        if (!path) {
                fail("Failed to resolve sample INI file path")
This page took 0.023162 seconds and 4 git commands to generate.