Skip to content

Commit 1182ce6

Browse files
authored
Rollup merge of #107900 - ChrisDenton:zero-header, r=thomcc
Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header Makes sure the full header is correctly initialized. Fixes #107884
2 parents 89358bd + b92a531 commit 1182ce6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

std/src/sys/windows/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,8 @@ fn symlink_junction_inner(original: &Path, junction: &Path) -> io::Result<()> {
13931393
let mut data = Align8([MaybeUninit::<u8>::uninit(); c::MAXIMUM_REPARSE_DATA_BUFFER_SIZE]);
13941394
let data_ptr = data.0.as_mut_ptr();
13951395
let db = data_ptr.cast::<c::REPARSE_MOUNTPOINT_DATA_BUFFER>();
1396+
// Zero the header to ensure it's fully initialized, including reserved parameters.
1397+
*db = mem::zeroed();
13961398
let buf = ptr::addr_of_mut!((*db).ReparseTarget).cast::<c::WCHAR>();
13971399
let mut i = 0;
13981400
// FIXME: this conversion is very hacky

0 commit comments

Comments
 (0)