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.
As long as I add bash to the mapping file in any way (like bash=bash or foo,3.5=bash), it works as expected. I could reproduce this as far back as 13ec561b78ca9c4ff18a69c1f96aa9aff869cab0.
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..
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
bash
to the mapping file in any way (likebash=bash
orfoo,3.5=bash
), it works as expected. I could reproduce this as far back as 13ec561b78ca9c4ff18a69c1f96aa9aff869cab0.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..