diff options
author | Paul Nasrat <pnasrat@redhat.com> | 2007-04-16 13:14:17 +0100 |
---|---|---|
committer | Paul Nasrat <pnasrat@redhat.com> | 2007-04-16 13:14:17 +0100 |
commit | 5fdd5efb26d67e89c5d1cda51435de2896348102 (patch) | |
tree | c12d2a95fb25a22c9eb9e9fc7582dc1b7358e7d2 /build | |
parent | fd6e4142505093ca91aafcba1351bb33820ae39a (diff) | |
download | librpm-tizen-5fdd5efb26d67e89c5d1cda51435de2896348102.tar.gz librpm-tizen-5fdd5efb26d67e89c5d1cda51435de2896348102.tar.bz2 librpm-tizen-5fdd5efb26d67e89c5d1cda51435de2896348102.zip |
Fix segfault when rpmbuild stumbles over an empty file list.
The "+ 1" is a remedy for xmalloc(0), which would return NULL.
Patch from OpenSuSE
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c index f1d6a19a8..c38b0d34a 100644 --- a/build/files.c +++ b/build/files.c @@ -1392,7 +1392,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, : (int *)(fi->bnl + fi->fc); /*@=dependenttrans@*/ - fi->apath = xmalloc(fi->fc * sizeof(*fi->apath) + apathlen); + fi->apath = xmalloc(fi->fc * sizeof(*fi->apath) + apathlen + 1); a = (char *)(fi->apath + fi->fc); *a = '\0'; |