Avoided information leak when processing garbled compressed data

When a compressed file has been deteriorated through hardware error
or accidental overwriting, some unrelated data could be leaked.
Make sure to zero fill the buffer when this happens.
This commit is contained in:
Jean-Pierre André 2020-08-14 11:36:57 +02:00
parent 6bdd1e85ac
commit 1bc996f52f

View File

@ -491,6 +491,8 @@ do_next_sb:
* first two checks do not detect it.
*/
if (cb == cb_end || !le16_to_cpup((le16*)cb) || dest == dest_end) {
if (dest_end > dest)
memset(dest, 0, dest_end - dest);
ntfs_log_debug("Completed. Returning success (0).\n");
return 0;
}