Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashfs: remove deprecated strncpy by not copying the string
Squashfs copied the passed string (name) into a temporary buffer to ensure it was NUL-terminated. This however is completely unnecessary as the string is already NUL-terminated. So remove the deprecated strncpy() by completely removing the string copy. The background behind this unnecessary string copy is that it dates back to the days when Squashfs was an out of kernel patch. The code deliberately did not assume the string was NUL-terminated in case in future this changed (due to kernel changes). This would mean the out of tree patches would be broken but still compile OK. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Phillip Lougher <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Justin Stitt <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information