Fix: Possible buffer overflows in strncat() usage
[lttng-tools.git] / src / common / utils.c
index 0494b23bdcd0bd356f45c0f4f8c5bf8a0f99c871..729aa76f9fd161ddeefbafc19db6374e3da14e54 100644 (file)
@@ -70,7 +70,7 @@ char *utils_expand_path(const char *path)
        }
 
        /* Add end part to expanded path */
-       strncat(expanded_path, end_path, PATH_MAX);
+       strncat(expanded_path, end_path, PATH_MAX - strlen(expanded_path) - 1);
 
        free(cut_path);
        return expanded_path;
This page took 0.022707 seconds and 4 git commands to generate.