mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Fix a possible segfault in alpm/remove.c
Before removing a package from target list (in remove_prepare_keep_needed), we should check whether we have already removed it. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
03021713e5
commit
5929508198
@ -120,6 +120,9 @@ static void remove_prepare_keep_needed(pmtrans_t *trans, pmdb_t *db,
|
|||||||
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
|
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
|
||||||
void *vpkg;
|
void *vpkg;
|
||||||
pmpkg_t *pkg = _alpm_pkg_find(trans->packages, miss->causingpkg);
|
pmpkg_t *pkg = _alpm_pkg_find(trans->packages, miss->causingpkg);
|
||||||
|
if(pkg == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
trans->packages = alpm_list_remove(trans->packages, pkg, _alpm_pkg_cmp,
|
trans->packages = alpm_list_remove(trans->packages, pkg, _alpm_pkg_cmp,
|
||||||
&vpkg);
|
&vpkg);
|
||||||
pkg = vpkg;
|
pkg = vpkg;
|
||||||
|
Loading…
Reference in New Issue
Block a user