FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-16-2008, 01:36 PM
Nagy Gabor
 
Default Fix a possible segfault in alpm/remove.c

>From 7aff060a6288b250d398fb47abcb2aa26f05a508 Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Date: Wed, 16 Jul 2008 15:27:37 +0200
Subject: [PATCH] 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>
---
lib/libalpm/remove.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 625abe6..864fafa 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -120,6 +120,9 @@ static void remove_prepare_keep_needed(pmtrans_t *trans, pmdb_t *db,
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
void *vpkg;
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,
&vpkg);
pkg = vpkg;
--
1.5.6.2


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 10:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org