Skip to content

std: fix Windows junction_point reparse buffer and rollback#549

Open
SebTardif wants to merge 1 commit into
mainfrom
fix/win-junction-point
Open

std: fix Windows junction_point reparse buffer and rollback#549
SebTardif wants to merge 1 commit into
mainfrom
fix/win-junction-point

Conversation

@SebTardif

@SebTardif SebTardif commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Write the mount-point substitute-name terminating NUL (fix uninit IOCTL input) and roll back the created directory if reparse setup fails.

Problem

  1. PrintNameOffset reserved a NUL slot after the substitute name but that u16 was never written (MaybeUninit path buffer, Windows junction_point() passes uninitialized memory as null terminators #263).
  2. Failure after create_new left an empty non-junction directory.

Change

library/std/src/sys/fs/windows.rs junction_point: write 0u16 after substitute name; adjust ReparseDataLength; on error drop handle and best-effort rmdir.

Origin

Lines Commit Date Author
1636-1712 d6945f6d8c1 2025-07-17 ltdk

Closes #263
Closes #548

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif SebTardif added bug Something isn't working I-wrong Wrong result or data corruption P-medium Medium impact: affects specific usage patterns O-windows Windows-specific A-libs Standard library labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-libs Standard library bug Something isn't working I-wrong Wrong result or data corruption O-windows Windows-specific P-medium Medium impact: affects specific usage patterns

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows junction_point leaves empty directory when reparse setup fails Windows junction_point() passes uninitialized memory as null terminators

1 participant