Skip to content

Fix symlink payload reading with io.ReadFull#43

Open
Rupikz wants to merge 1 commit into
sassoftware:masterfrom
Rupikz:fix-read-full-symlink-file
Open

Fix symlink payload reading with io.ReadFull#43
Rupikz wants to merge 1 commit into
sassoftware:masterfrom
Rupikz:fix-read-full-symlink-file

Conversation

@Rupikz
Copy link
Copy Markdown

@Rupikz Rupikz commented Nov 19, 2025

When reading symlink files, we might hit a case where we try to read an N-byte payload while the remaining buffer has fewer than N bytes left. This results in a corrupted string and causes subsequent os.Symlink() calls to fail during ignoringEINTR() checks.

This fix replaces the current reading approach with io.ReadFull to ensure we fully read exactly N bytes, as recommended in bufio package.

@mtharp Please take a look.

Signed-off-by: Kudryavcev Nikolay <kydry.nikolau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant