Zeroed uninitialized bytes before writing compressed data
Compressed records may be written as full clusters even though cluster tails are meaningless. This is to avoid the lower levels doing a read- modify-write cycle. Be sure to zero the meaningless bytes to avoid leaking information. Contributed by Eric Biggerspull/2/head
parent
bd2c91d4a3
commit
5741f54529
|
@ -1131,6 +1131,7 @@ static s32 ntfs_comp_set(ntfs_attr *na, runlist_element *rl,
|
|||
outbuf[compsz++] = 0;
|
||||
/* write a full cluster, to avoid partial reading */
|
||||
rounded = ((compsz - 1) | (clsz - 1)) + 1;
|
||||
memset(&outbuf[compsz], 0, rounded - compsz);
|
||||
written = write_clusters(vol, rl, offs, rounded, outbuf);
|
||||
if (written != rounded) {
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue