Make sure there's room for \0 (packages with no files)
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 16 Jul 2008 09:07:03 +0000 (12:07 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 16 Jul 2008 09:07:03 +0000 (12:07 +0300)
build/files.c

index 8931cfb..e87f487 100644 (file)
@@ -1188,7 +1188,7 @@ static void genCpioListAndHeader(FileList fl,
     fi->bnl = _free(fi->bnl);
     if (!scareMem) fi->dil = _free(fi->dil);
 
-    fi->dnl = xmalloc(fi->fc * sizeof(*fi->dnl) + dpathlen);
+    fi->dnl = xmalloc(fi->fc * sizeof(*fi->dnl) + dpathlen + 1);
     d = (char *)(fi->dnl + fi->fc);
     *d = '\0';