]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
make addfilelist more resistant against corrupt rpms
authorMichael Schroeder <mls@suse.de>
Mon, 13 Jan 2014 17:25:50 +0000 (18:25 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 21 Feb 2014 17:00:48 +0000 (18:00 +0100)
ext/repo_rpmdb.c

index ceeb7fb4c453aac8ee06fb631784f12497949679..922e1d1022d3dee28cc5072c7b7ae2d58d29450f 100644 (file)
@@ -644,7 +644,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;
@@ -682,7 +682,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;
@@ -719,6 +719,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);