diff options
author | Michael Schroeder <mls@suse.de> | 2014-01-13 18:25:50 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-01-13 18:25:50 +0100 |
commit | 20031e223d33af667c9b7e3106ea9c19ec4fbce7 (patch) | |
tree | 1ef36aa7b012c7ec78f325fc180a4680c2a941a8 /ext | |
parent | 1c4b8b63f06ab4ff05f118e029679a8a882fe91a (diff) | |
download | libsolv-20031e223d33af667c9b7e3106ea9c19ec4fbce7.tar.gz libsolv-20031e223d33af667c9b7e3106ea9c19ec4fbce7.tar.bz2 libsolv-20031e223d33af667c9b7e3106ea9c19ec4fbce7.zip |
make addfilelist more resistant against corrupt rpms
Diffstat (limited to 'ext')
-rw-r--r-- | ext/repo_rpmdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 0bfb503..9ab49d6 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -645,7 +645,7 @@ adddudata(Repodata *data, Id handle, RpmHead *rpmhead, char **dn, unsigned int * for (i = 0; i < fc; i++) { if (di[i] >= dc) - continue; + continue; /* corrupt entry */ fn[di[i]]++; if (fsz[i] == 0 || !S_ISREG(fm[i])) continue; @@ -683,7 +683,7 @@ addfilelist(Repodata *data, Id handle, RpmHead *rpmhead) int bnc, dnc, dic; int i; Id lastdid = 0; - int lastdii = -1; + unsigned int lastdii = -1; if (!data) return; @@ -720,6 +720,8 @@ addfilelist(Repodata *data, Id handle, RpmHead *rpmhead) did = lastdid; else { + if (di[i] >= dnc) + continue; /* corrupt entry */ did = repodata_str2dir(data, dn[di[i]], 1); if (!did) did = repodata_str2dir(data, "/", 1); |