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>
This commit is contained in:
Bruno Widmann 2010-10-20 08:59:34 +02:00 committed by Dan McGee
parent ed367fe96d
commit 5f36523af9
1 changed files with 3 additions and 0 deletions

View File

@ -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);