• Sören Tempel's avatar
    list: fix segmentation fault with virtual packages · 5c4b90df
    Sören Tempel authored
    Virtual packages have the origin pointer set to NULL. Trying to print it
    using the BLOB_PRINTF macros causes a segmentation fault.
    
    Inspired by the `print_origin_name` function from `src/search.c` this
    commit attempts to fix it by checking whether `pkg->origin` is NULL
    before attempting to print it. If it is NULL the pkg name is printed
    instead.
    
    Since printing the pkg name requires a different format string this
    commit splits the printf call for printing the package line into
    multiple ones. The output format shouldn't have changed at all though.
    5c4b90df
Name
Last commit
Last update
..
Makefile Loading commit data...
add.c Loading commit data...
apk-static.c Loading commit data...
apk-test.c Loading commit data...
apk.c Loading commit data...
apk_applet.h Loading commit data...
apk_archive.h Loading commit data...
apk_blob.h Loading commit data...
apk_database.h Loading commit data...
apk_defines.h Loading commit data...
apk_hash.h Loading commit data...
apk_io.h Loading commit data...
apk_package.h Loading commit data...
apk_print.h Loading commit data...
apk_provider_data.h Loading commit data...
apk_solver.h Loading commit data...
apk_solver_data.h Loading commit data...
apk_version.h Loading commit data...
archive.c Loading commit data...
audit.c Loading commit data...
blob.c Loading commit data...
cache.c Loading commit data...
commit.c Loading commit data...
common.c Loading commit data...
database.c Loading commit data...
del.c Loading commit data...
dot.c Loading commit data...
fetch.c Loading commit data...
fix.c Loading commit data...
gunzip.c Loading commit data...
hash.c Loading commit data...
index.c Loading commit data...
info.c Loading commit data...
io.c Loading commit data...
list.c Loading commit data...
lua-apk.c Loading commit data...
manifest.c Loading commit data...
md5.h Loading commit data...
package.c Loading commit data...
policy.c Loading commit data...
print.c Loading commit data...
search.c Loading commit data...
solver.c Loading commit data...
stats.c Loading commit data...
template.c Loading commit data...
update.c Loading commit data...
upgrade.c Loading commit data...
url.c Loading commit data...
ver.c Loading commit data...
verify.c Loading commit data...
version.c Loading commit data...