diff options
author | Bruno Widmann <bruno.widmann@gmail.com> | 2010-10-20 08:59:34 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-12-13 23:45:22 +0100 |
commit | 5f36523af9de20a8c74714da4125bb553b0fae2c (patch) | |
tree | 0a893eba12bb16c3cd3163ca210d6e5b971636db /lib | |
parent | ed367fe96d36fabe4127deab99df98cdb834145a (diff) | |
download | pacman-5f36523af9de20a8c74714da4125bb553b0fae2c.tar.gz pacman-5f36523af9de20a8c74714da4125bb553b0fae2c.tar.xz |
Abort db_populate if dbpath is not set
Rather than segfault. Fixes FS#21345.
Signed-off-by: Bruno Widmann <bruno.widmann@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/be_local.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 9dce66df..7d5d0c2d 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -367,6 +367,9 @@ int _alpm_local_db_populate(pmdb_t *db) ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); dbpath = _alpm_db_path(db); + if(dbpath == NULL) { + return(-1); + } dbdir = opendir(dbpath); if(dbdir == NULL) { return(0); |