Repository navigation
Conversation
This branch has not been deployed
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.
xbps_dictionary_get_cstring_nocopy() leaves its out pointer untouched when the key is absent or is not a string, and collect_files, xbps_entry_is_a_conf_file, xbps_entry_install_conf_file and file_hash_dictionary all ignore the return value. the dictionary they walk is ./files.plist read straight out of a binary package archive, so an entry without a "file" key leaves them to strcmp/snprintf an uninitialized stack pointer. to see it: build a package with xbps-create --compression none, rename the file keys in its files.plist (the replacement has the same length, so the uncompressed tar stays valid), reindex and install it. valgrind reports
Invalid read of size 1 ... 0 bytes inside a block of size 80 free'din collect_file via addItem, and the install still succeeds, recording whatever that stale proplib buffer spelled as the package's file list. packages from a local repository are only checked against the sha256 in that repository's own repodata, so the index and the archive come from the same place. a malformed entry is now EINVAL in collect_files and skipped in the conf file and hash lookups, which leaves valid packages untouched. the new install_test case asserts the rejection and fails on the unpatched tree.