From: Panu Matilainen Date: Thu, 23 Jun 2011 06:47:10 +0000 (+0300) Subject: Eliminate static BUFSIZ use in filelist parsing X-Git-Tag: rpm-4.10.0-beta1~417 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cc0fc99c582f415da3380539fb620592bfc4b00;p=platform%2Fupstream%2Frpm.git Eliminate static BUFSIZ use in filelist parsing - 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. --- diff --git a/build/files.c b/build/files.c index 4f73548..beddc52 100644 --- a/build/files.c +++ b/build/files.c @@ -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')