]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix of by one error in repo_deb that could lead to missing packages
authorMichael Schroeder <mls@suse.de>
Mon, 18 Apr 2016 15:40:26 +0000 (17:40 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 18 Apr 2016 15:40:26 +0000 (17:40 +0200)
ext/repo_deb.c

index 35dcc8483b028ed1bd7ae9f2f887215055f1b0e1..812f3d91cb4cb82b62811be31bf1968ac26a5650 100644 (file)
@@ -388,12 +388,10 @@ repo_add_debpackages(Repo *repo, FILE *fp, int flags)
       if (!(p = strchr(p, '\n')))
        {
          int l3;
-         if (l + 1024 >= bufl)
+         while (l + 1024 >= bufl)
            {
              buf = solv_realloc(buf, bufl + 4096);
              bufl += 4096;
-             p = buf + l;
-             continue;
            }
          p = buf + l;
          ll = fread(p, 1, bufl - l - 1, fp);
@@ -403,6 +401,8 @@ repo_add_debpackages(Repo *repo, FILE *fp, int flags)
          while ((l3 = strlen(p)) < ll)
            p[l3] = '\n';
          l += ll;
+         if (p != buf)
+           p--;
          continue;
        }
       p++;