From 5f36523af9de20a8c74714da4125bb553b0fae2c Mon Sep 17 00:00:00 2001 From: Bruno Widmann Date: Wed, 20 Oct 2010 08:59:34 +0200 Subject: Abort db_populate if dbpath is not set Rather than segfault. Fixes FS#21345. Signed-off-by: Bruno Widmann Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libalpm') 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); -- cgit v1.2.3-70-g09d2