Commit fe517f92 authored by Kirill Smirnov's avatar Kirill Smirnov Committed by Alexandre Julliard

regedit: Fix an out-of-bounds array access (clang).

parent 0adf2af7
...@@ -105,8 +105,8 @@ static void get_file_name(CHAR **command_line, CHAR *file_name) ...@@ -105,8 +105,8 @@ static void get_file_name(CHAR **command_line, CHAR *file_name)
} }
} }
memcpy(file_name, *command_line, pos * sizeof((*command_line)[0])); memcpy(file_name, *command_line, pos * sizeof((*command_line)[0]));
/* remove the last backslash */ /* Terminate the string and remove the trailing backslash */
if (file_name[pos - 1] == '\\') { if (pos > 0 && file_name[pos - 1] == '\\') {
file_name[pos - 1] = '\0'; file_name[pos - 1] = '\0';
} else { } else {
file_name[pos] = '\0'; file_name[pos] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment