summaryrefslogtreecommitdiff
path: root/user/fastjar/fix-update-mode.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-11-11 17:37:52 -0600
committerZach van Rijn <me@zv.io>2022-11-11 17:45:10 -0600
commiteee8b8ef4d2ee4cbf2d74bc7fd27c5d857e44ec5 (patch)
treecef56a73be9337b2d4d6a3c9c9f1138e5da8f3e3 /user/fastjar/fix-update-mode.patch
parentab1c259053596aaee4310a5e3f09591755e4ccf8 (diff)
downloadpackages-eee8b8ef4d2ee4cbf2d74bc7fd27c5d857e44ec5.tar.gz
packages-eee8b8ef4d2ee4cbf2d74bc7fd27c5d857e44ec5.tar.bz2
packages-eee8b8ef4d2ee4cbf2d74bc7fd27c5d857e44ec5.tar.xz
packages-eee8b8ef4d2ee4cbf2d74bc7fd27c5d857e44ec5.zip
user/fastjar: add patch for CVE-2010-{0831,2322} and updater. fixes #136, #841.
Diffstat (limited to 'user/fastjar/fix-update-mode.patch')
-rw-r--r--user/fastjar/fix-update-mode.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/user/fastjar/fix-update-mode.patch b/user/fastjar/fix-update-mode.patch
new file mode 100644
index 000000000..509651e44
--- /dev/null
+++ b/user/fastjar/fix-update-mode.patch
@@ -0,0 +1,44 @@
+Index: b/compress.c
+===================================================================
+--- a/compress.c
++++ b/compress.c
+@@ -86,6 +86,10 @@ write_data (int fd, void *buf, size_t le
+ exit(EXIT_FAILURE);
+ }
+ }
++ else if (!next && here + len >= end_of_entries)
++ {
++ end_of_entries = here + len;
++ }
+ }
+
+ return write (fd, buf, len);
+Index: b/jartool.c
+===================================================================
+--- a/jartool.c
++++ b/jartool.c
+@@ -1273,15 +1273,18 @@ int add_file_to_jar(int jfd, int ffd, co
+ compress_file(ffd, jfd, ze, existing);
+ } else {
+ /* If we are not writing the last entry, make space for it. */
+- if (existing && existing->next_entry)
++ if (existing)
+ {
+- if (ze->usize > existing->usize)
++ if (existing->next_entry)
+ {
+- if (shift_down (jfd, existing->next_entry->offset,
+- ze->usize - existing->usize, existing->next_entry))
++ if (ze->usize > existing->usize)
+ {
+- fprintf (stderr, "%s: %s\n", progname, strerror (errno));
+- return 1;
++ if (shift_down (jfd, existing->next_entry->offset,
++ ze->usize - existing->usize, existing->next_entry))
++ {
++ fprintf (stderr, "%s: %s\n", progname, strerror (errno));
++ return 1;
++ }
+ }
+ }
+ }