Eliminate static BUFSIZ use in filelist parsing
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 23 Jun 2011 06:47:10 +0000 (09:47 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 23 Jun 2011 06:47:10 +0000 (09:47 +0300)
- In the unlikely event of filelist line being longer than BUFSIZ
  we'd previously end up truncating the line, which is stupid
  since we can just as easily make the buffer large enough.

build/files.c

index 4f73548..beddc52 100644 (file)
@@ -1769,7 +1769,7 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
     fl.fileListRecsUsed = 0;
 
     for (ARGV_const_t fp = pkg->fileList; *fp != NULL; fp++) {
-       char buf[BUFSIZ];
+       char buf[strlen(*fp) + 1];
        const char *s = *fp;
        SKIPSPACE(s);
        if (*s == '\0')