aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-08-03 16:27:20 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-08-03 16:28:33 +0200
commitde80fb9f36b7f7a4a0d6d7cdd92fa70c9ed4608c (patch)
treee30ee781e010157bee43c31581994890beb4edf5
parentdb2b644503f6e97982eb55479df9c9ff6d7743bd (diff)
downloadaports-de80fb9f36b7f7a4a0d6d7cdd92fa70c9ed4608c.tar.bz2
aports-de80fb9f36b7f7a4a0d6d7cdd92fa70c9ed4608c.tar.xz
main/busybox: fix busybox compression level bug
reported upstream: https://bugs.busybox.net/show_bug.cgi?id=9131
-rw-r--r--main/busybox/0001-gzip-fix-compression-level-bug.-Closes-9131.patch41
-rw-r--r--main/busybox/APKBUILD7
2 files changed, 47 insertions, 1 deletions
diff --git a/main/busybox/0001-gzip-fix-compression-level-bug.-Closes-9131.patch b/main/busybox/0001-gzip-fix-compression-level-bug.-Closes-9131.patch
new file mode 100644
index 0000000000..a13c68e39d
--- /dev/null
+++ b/main/busybox/0001-gzip-fix-compression-level-bug.-Closes-9131.patch
@@ -0,0 +1,41 @@
+From afe536411df2d4b080159aa461111fe56c25e30e Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 3 Aug 2016 13:23:57 +0200
+Subject: [PATCH] gzip: fix compression level bug. Closes 9131
+
+fix broken logic to get the gzip_level_config value from options -1 to
+-9.
+
+This fixes an off-by-one bug that caused gzip -9 output bigger files
+than the other compression levels.
+
+It fixes so that compression level 1 to 3 are actually mapped to level 4
+as comments say.
+
+It also fixes that levels -4 to -9 is mapped to correct level and avoids
+out-of-bounds access.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ archival/gzip.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/archival/gzip.c b/archival/gzip.c
+index 8f1e4ff..15ba57c 100644
+--- a/archival/gzip.c
++++ b/archival/gzip.c
+@@ -2220,10 +2220,7 @@ int gzip_main(int argc UNUSED_PARAM, char **argv)
+ opt >>= ENABLE_GUNZIP ? 7 : 5; /* drop cfv[dt]qn bits */
+ if (opt == 0)
+ opt = 1 << 6; /* default: 6 */
+- /* Map 1..3 to 4 */
+- if (opt & 0x7)
+- opt |= 1 << 4;
+- opt = ffs(opt >> 3);
++ opt = ffs(opt >> 4); /* Maps 1..3 to 4 */
+ max_chain_length = 1 << gzip_level_config[opt].chain_shift;
+ good_match = gzip_level_config[opt].good;
+ max_lazy_match = gzip_level_config[opt].lazy2 * 2;
+--
+2.9.1
+
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index ec240492a3..22fb652889 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.24.2
-pkgrel=9
+pkgrel=10
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="all"
@@ -58,6 +58,8 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
+ 0001-gzip-fix-compression-level-bug.-Closes-9131.patch
+
acpid.logrotate
busyboxconfig
glibc.patch"
@@ -202,6 +204,7 @@ f5adc07a1937c4ee36e231f32799515e 4005-ntpd-do-not-use-a-peer-more-than-once-say
a4d1cf64fd1835a284ccc6dbc78e3ce0 0001-ash-fix-error-during-recursive-processing-of-here-do.patch
ab539a54dcd1c23eb0963e17e768fef7 0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
d77da40a3c1291ab82513fb59c517e38 0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
+e8dea4f51fb8cf606e3c6a33e40fa644 0001-gzip-fix-compression-level-bug.-Closes-9131.patch
4046b78ee6a25259954797d73b94f4bd acpid.logrotate
ab4a2e1385566b01002e526614dd38c2 busyboxconfig
befaac2c59c380e36a452b3f1c1d4a3a glibc.patch"
@@ -238,6 +241,7 @@ f712ce190ce86084d56977e125d1561615394f3d9b840e926537868260e19d79 0001-ash-backp
1d3f8f7b6d0972f8e56437fce8efbafe70e2d869fbe82f06eba11e0103fce224 0001-ash-fix-error-during-recursive-processing-of-here-do.patch
97dfec94c94f00b628a702ad81b235414af611e011bfc26c29be46c67063c101 0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
8dba75a5de5c808760e9439ad38b35f643a2442e9e5aca4b40b918cfc66ac255 0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
+9ab63b013ad9edca66005c10ea58702e54b170155562baf7cb1d4a13f16196c6 0001-gzip-fix-compression-level-bug.-Closes-9131.patch
f7cbeb5a5a47395ad30454ce8262abcd3e91c33ef803c2ae31a9258d7142dd48 acpid.logrotate
a129ededc4c5ec3d0385e4da50a87e81f348ecc7541a2105dd98f0c8543a3a2f busyboxconfig
c604ef791c31d35a8c5ee4558d21428a46f37a6d762c4a7e29864f4037fc44a0 glibc.patch"
@@ -274,6 +278,7 @@ d55cab6ed08434e2a278edf1be6171b921bcaee47598988e4de6b390a01569e10394c54d5d4a27e6
c14a632f9477c13ea99b24a73c81c9c44ead8b536970acd758e739b43a6260860039674341192ce7bb20a9204ee7d93dcd9541e526f2437d4d2d88637b400867 0001-ash-fix-error-during-recursive-processing-of-here-do.patch
6fc77e0edcbb61a64c179b0259e0634a82362ac0ca9a77f305eb75f6a89a10395e8a37cbcef925821b428c00237a0a3575af2c3ef194933f52ad55b0eb0dd6f2 0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
a42d4b992b3ba3b33a605d7f919c574783034b99cd046fd394c040948360daef7f9fb5717994c5326187a185ee9f357b36f405e960ab632c2f59f5b9fba402f7 0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
+afa0aa2fee08b28b6f4a32bd761d9fd7ab6989a13651ffa9dc8a3a3c4de3c646ce0881c2abd1be96768ddb326451f2e06125e2959c42de6f339e90994461a803 0001-gzip-fix-compression-level-bug.-Closes-9131.patch
dadb4c953ebc755b88ee95c1489feb0c2d352f6e44abc716166024e6eea11ab9d10c84fad62c081775834d205cb04aa1be3c994676c88f4284495c54b9188e8b acpid.logrotate
580a6e15d6517641951bb1648c406cee2a82fab353552a60d37f29e5f58da664437d99d5bd313d88e260a92735c32886ffc1cad98f901bb27d1f5027fdce37d7 busyboxconfig
1d2739379dab1deb3eae7cffd4845300eb7d30f7343b4a1209b21a5680860d55080ad45fdefe098b249ce3040c01951fa7f0a79cd447b2d7b260eb000099d9dc glibc.patch"