This repository was archived by the owner on Jan 6, 2023. It is now read-only.
Check if the package is in the mapping hash before trying to update it#65
Open
mgpb wants to merge 1 commit intoclearlinux:masterfrom
Open
Check if the package is in the mapping hash before trying to update it#65mgpb wants to merge 1 commit intoclearlinux:masterfrom
mgpb wants to merge 1 commit intoclearlinux:masterfrom
Conversation
Otherwise, the lookup returns NULL but is still passed to g_strsplit().
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Hello!
When working with a list of faux packages and using a mapping file, I found that unless every package has a corresponding mapping entry, I get a segfault.
packages.csv:
mapping:
Result:
As long as I add
bashto the mapping file in any way (likebash=bashorfoo,3.5=bash), it works as expected. I could reproduce this as far back as 13ec561.The code makes sure there is a mapping hash but not whether the package is a key in it, so the NULL returned by the lookup is passed to g_strsplit().
I thought
g_hash_table_contains()makes sense here since the table and the loop are still using the glib functions, but I also realize you wanted to get away from glib in general, so I could alternatively wrap the stuff in that block with a check that q isn't NULL first if that's preferable..