Commit 2b0ada2b authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Fix handling of valid but empty mapping pairs array in

      fs/ntfs/runlist.c::ntfs_mapping_pairs_decompress().
Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 8bb73521
...@@ -46,6 +46,8 @@ ToDo/Notes: ...@@ -46,6 +46,8 @@ ToDo/Notes:
- Fix two nasty runlist merging bugs that had gone unnoticed so far. - Fix two nasty runlist merging bugs that had gone unnoticed so far.
Thanks to Stefano Picerno for the bug report. Thanks to Stefano Picerno for the bug report.
- Remove two bogus BUG_ON()s from fs/ntfs/mft.c. - Remove two bogus BUG_ON()s from fs/ntfs/mft.c.
- Fix handling of valid but empty mapping pairs array in
fs/ntfs/runlist.c::ntfs_mapping_pairs_decompress().
2.1.23 - Implement extension of resident files and make writing safe as well as 2.1.23 - Implement extension of resident files and make writing safe as well as
many bug fixes, cleanups, and enhancements... many bug fixes, cleanups, and enhancements...
......
...@@ -760,6 +760,9 @@ runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol, ...@@ -760,6 +760,9 @@ runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
ntfs_error(vol->sb, "Corrupt attribute."); ntfs_error(vol->sb, "Corrupt attribute.");
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
/* If the mapping pairs array is valid but empty, nothing to do. */
if (!vcn && !*buf)
return old_rl;
/* Current position in runlist array. */ /* Current position in runlist array. */
rlpos = 0; rlpos = 0;
/* Allocate first page and set current runlist size to one page. */ /* Allocate first page and set current runlist size to one page. */
......
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