Fix: memcpy used on potentially overlapping regions
[lttng-tools.git] / src / common / utils.c
index 22fd33ea3f1a09e6fda886d242b686731adda8ae..5420490a76a40f1d66d504f46e545aaebba56f78 100644 (file)
@@ -300,7 +300,7 @@ int expand_double_slashes_dot_and_dotdot(char *path)
                 * Copy the current token which is neither a '.' nor a '..'.
                 */
                path[expanded_path_len++] = '/';
-               memcpy(&path[expanded_path_len], curr_char, curr_token_len);
+               memmove(&path[expanded_path_len], curr_char, curr_token_len);
                expanded_path_len += curr_token_len;
        }
 
@@ -547,6 +547,7 @@ void utils_close_pipe(int *src)
                if (ret) {
                        PERROR("close pipe");
                }
+               src[i] = -1;
        }
 }
 
This page took 0.023465 seconds and 4 git commands to generate.