commit | 72f6b7806c955749ca580cd17d64b590354a58bf | [log] [tgz] |
---|---|---|
author | Peter Collingbourne <pcc@google.com> | Fri Jul 26 15:33:09 2024 -0700 |
committer | Jaegeuk Kim <jaegeuk@kernel.org> | Tue Jul 30 16:31:59 2024 +0000 |
tree | 2b401b1fb0f668573e43d2426ea0fe2190fb32c0 | |
parent | 1aeab18dc61407a4c384c628435e7829c0e5c518 [diff] |
mkfs.f2fs: Fix out-of-bounds read in f2fs_prepare_super_block The path field in c.devices[i] is a pointer and is normally filled in using strdup. This makes it invalid to copy MAX_PATH_LEN bytes from it because the string may be shorter than that. Therefore, fix the code to use strncpy to copy the string instead. Signed-off-by: Peter Collingbourne <pcc@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>