projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd6e414
)
Fix segfault when rpmbuild stumbles over an empty file list.
author
Paul Nasrat
<pnasrat@redhat.com>
Mon, 16 Apr 2007 12:14:17 +0000
(13:14 +0100)
committer
Paul Nasrat
<pnasrat@redhat.com>
Mon, 16 Apr 2007 12:14:17 +0000
(13:14 +0100)
The "+ 1" is a remedy for xmalloc(0), which would return NULL.
Patch from OpenSuSE
build/files.c
patch
|
blob
|
history
diff --git
a/build/files.c
b/build/files.c
index
f1d6a19
..
c38b0d3
100644
(file)
--- 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';