Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Widmann <bruno.widmann@gmail.com>2010-10-20 08:59:34 +0200
committerDan McGee <dan@archlinux.org>2010-12-13 16:45:22 -0600
commit5f36523af9de20a8c74714da4125bb553b0fae2c (patch)
tree0a893eba12bb16c3cd3163ca210d6e5b971636db /lib
parented367fe96d36fabe4127deab99df98cdb834145a (diff)
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.c3
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);