index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-08-28 22:20:41 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-28 23:49:27 -0500 |
commit | b221af660d101301606e263cef73b358937516a6 (patch) | |
tree | e49e89dbd2314e9b2f972c29d14dc0c63a61121a /lib/libalpm | |
parent | 040083b97fab61c8afc16a1c49a8384d097c272a (diff) |
-rw-r--r-- | lib/libalpm/be_local.c | 8 | ||||
-rw-r--r-- | lib/libalpm/be_sync.c | 5 |
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 1a46dfdf..be02bb50 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -580,7 +580,13 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) goto error; } while(!feof(fp)) { - READ_NEXT(); + if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) { + goto error; + } + if(_alpm_strip_newline(line) == 0) { + /* length of stripped line was zero */ + continue; + } if(strcmp(line, "%NAME%") == 0) { READ_NEXT(); if(strcmp(line, info->name) != 0) { diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index ac99e05e..12d5b7fe 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -526,7 +526,10 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive, int ret; while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) { char *line = buf.line; - _alpm_strip_newline(line); + if(_alpm_strip_newline(line) == 0) { + /* length of stripped line was zero */ + continue; + } if(strcmp(line, "%NAME%") == 0) { READ_NEXT(); |