Fix potential buffer overflow in strncat() invocation

strncat() will copy at most the specified number of characters and append
the null character on top of that. strlen() doesn't count the final null
character.
This commit is contained in:
Pavel Roskin 2016-11-10 17:43:36 -08:00
parent e8185caf31
commit 92423a466e

View File

@ -2200,7 +2200,7 @@ static void xfuse_remove_dir_or_file(fuse_req_t req, fuse_ino_t parent,
}
strcat(full_path, "/");
strncat(full_path, name, sizeof(full_path) - strlen(full_path));
strncat(full_path, name, sizeof(full_path) - strlen(full_path) - 1);
if (xinode->is_loc_resource)
{