Repository navigation
Conversation
If the buffer is too small, readlink() returns the number of bytes that would have been stored if the buffer had been large enough. Signed-off-by: Simon McVittie <[email protected]>
readlink() and readlinkat() have weird semantics (they return the number of bytes they would have written if there was enough space, even if that's larger than the buffer), but glnx_readlinkat_malloc() takes care to do the right thing in all situations. Signed-off-by: Simon McVittie <[email protected]>
Collaborator
|
📌 Commit 8d1c3c6 has been approved by |
|
⚡ Test exempted: pull fully rebased and already tested. |
rh-atomic-bot
pushed a commit
that referenced
this pull request
May 1, 2019
readlink() and readlinkat() have weird semantics (they return the number of bytes they would have written if there was enough space, even if that's larger than the buffer), but glnx_readlinkat_malloc() takes care to do the right thing in all situations. Signed-off-by: Simon McVittie <[email protected]> Closes: #2873 Approved by: matthiasclasen
alexlarsson
pushed a commit
to alexlarsson/flatpak
that referenced
this pull request
Sep 19, 2019
If the buffer is too small, readlink() returns the number of bytes that would have been stored if the buffer had been large enough. Signed-off-by: Simon McVittie <[email protected]> Closes: flatpak#2873 Approved by: matthiasclasen (cherry picked from commit 89dc344)
rh-atomic-bot
pushed a commit
that referenced
this pull request
Sep 19, 2019
If the buffer is too small, readlink() returns the number of bytes that would have been stored if the buffer had been large enough. Signed-off-by: Simon McVittie <[email protected]> Closes: #2873 Approved by: matthiasclasen (cherry picked from commit 89dc344) Closes: #3115 Approved by: alexlarsson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
readlink() and readlinkat() have weird semantics: they return the number of bytes they would have written if there was enough space, even if that's larger than the buffer. Flatpak didn't always cope with this, and it looks as though it might write
\0outside the buffer if a symlink target is longer thanPATH_MAX.glnx_readlinkat_malloc()takes care to do the right thing in all situations, so use that where possible.In the icon validator and the portal, which don't currently use libglnx, treat an excessively long symlink target as an error instead.