fix off-by-1 alloca that prevented relocating /.

CVS patchset: 2504
CVS date: 1998/10/27 19:54:08
This commit is contained in:
jbj 1998-10-27 19:54:08 +00:00
parent 62efcbd3fc
commit 482a553ada
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@
- add {init,add,expand}Macro args everywhere (new macro.c compatibility)
- add new fully recursive macro.c
2.5.5 -> 2.5.6:
- fix off-by-1 alloca that prevented relocating /.
2.5.4 -> 2.5.5:
- permit rpm to be built in a sub-directory (--srcdir=DIR).
- return CPIO_BAD_HEADER instead of exiting. (Scott M. Stone)

View File

@ -270,7 +270,7 @@ static int assembleFileList(Header h, struct fileMemory * mem,
} while (rc > 0 && nextReloc);
if (!rc) {
newName = alloca(newLen + strlen(mem->names[i]));
newName = alloca(newLen + strlen(mem->names[i]) + 1);
strcpy(newName, nextReloc->newPath);
strcat(newName, mem->names[i] + len);
rpmMessage(RPMMESS_DEBUG, _("relocating %s to %s\n"),