Skip to content

Commit

Permalink
Avoid segfault during upgrade with package removal.
Browse files Browse the repository at this point in the history
This isn't actually supported at present, but I want some time to create
proper test cases and handle everything correctly, so for now we punt
and ignore removals which is how pkgin behaved prior to 20.7.0.

Apologies for the crashes, but in my defence it exposed a real bug,
which was the reason for removing the checks in the first place.

Should "fix" #94, and reports via private message.
  • Loading branch information
Jonathan Perkin committed Aug 28, 2020
1 parent b81a6d4 commit c88002c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions order.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ order_install(Plisthead *impacthead)
if (pimpact->level != i)
continue;

/*
* XXX: This is incorrect, removals need to be handled
* properly during upgrades, but is necessary for now
* to avoid issues with pkgurl being set to NULL.
*/
if (pimpact->action == TOREMOVE)
continue;

pdp = malloc_pkglist();

pdp->action = pimpact->action;
Expand Down

0 comments on commit c88002c

Please sign in to comment.