Commit 4d372f9c authored by Andres Mejia's avatar Andres Mejia

Fixup changes so that CVE-2011-1777 fix is properly applied.

Fails to build otherwise.
parent 952e6fca
......@@ -19,6 +19,15 @@ Origin: backport, http://code.google.com/p/libarchive/source/detail?r=3158
#define next_entry(iso9660) \
heap_get_entry(&((iso9660)->pending_files))
@@ -974,7 +974,7 @@
if (child == NULL)
return (ARCHIVE_FATAL);
if (child->cl_offset)
- heap_add_entry(&(iso9660->cl_files),
+ heap_add_entry(a, &(iso9660->cl_files),
child, child->cl_offset);
else {
if (child->multi_extent || multi != NULL) {
@@ -999,15 +999,19 @@
con->next = NULL;
*multi->contents.last = con;
......@@ -43,7 +52,50 @@ Origin: backport, http://code.google.com/p/libarchive/source/detail?r=3158
}
}
}
@@ -1198,7 +1202,8 @@
@@ -1020,7 +1024,8 @@
}
static int
-relocate_dir(struct iso9660 *iso9660, struct file_info *file)
+relocate_dir(struct archive_read *a, struct iso9660 *iso9660,
+ struct file_info *file)
{
struct file_info *re;
@@ -1042,7 +1047,7 @@
return (1);
} else
/* This case is wrong pattern. */
- heap_add_entry(&(iso9660->re_dirs), re, re->offset);
+ heap_add_entry(a, &(iso9660->re_dirs), re, re->offset);
return (0);
}
@@ -1069,20 +1074,20 @@
strcmp(file->name.s, ".rr_moved") == 0)) {
iso9660->rr_moved = file;
} else if (file->re)
- heap_add_entry(&(iso9660->re_dirs), file,
+ heap_add_entry(a, &(iso9660->re_dirs), file,
file->offset);
else
cache_add_entry(iso9660, file);
}
if (file != NULL)
- add_entry(iso9660, file);
+ add_entry(a, iso9660, file);
if (iso9660->rr_moved != NULL) {
/*
* Relocate directory which rr_moved has.
*/
while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL)
- relocate_dir(iso9660, file);
+ relocate_dir(a, iso9660, file);
/* If rr_moved directory still has children,
* Add rr_moved into pending_files to show
@@ -1198,7 +1203,8 @@
iso9660->seenJoliet = seenJoliet;
}
/* Store the root directory in the pending list. */
......@@ -53,7 +105,7 @@ Origin: backport, http://code.google.com/p/libarchive/source/detail?r=3158
if (iso9660->seenRockridge) {
a->archive.archive_format =
ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
@@ -2625,8 +2630,8 @@
@@ -2625,8 +2631,8 @@
return (file);
}
......@@ -64,7 +116,7 @@ Origin: backport, http://code.google.com/p/libarchive/source/detail?r=3158
{
uint64_t file_key, parent_key;
int hole, parent;
@@ -2639,12 +2644,18 @@
@@ -2639,12 +2645,18 @@
if (heap->allocated < 1024)
new_size = 1024;
/* Overflow might keep us from growing the list. */
......@@ -87,7 +139,7 @@ Origin: backport, http://code.google.com/p/libarchive/source/detail?r=3158
memcpy(new_pending_files, heap->files,
heap->allocated * sizeof(new_pending_files[0]));
if (heap->files != NULL)
@@ -2664,13 +2675,15 @@
@@ -2664,13 +2676,15 @@
parent_key = heap->files[parent]->key;
if (file_key >= parent_key) {
heap->files[hole] = file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment