summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/be_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/be_local.c')
-rw-r--r--lib/libalpm/be_local.c8
1 files changed, 7 insertions, 1 deletions
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) {