mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-07 23:53:51 +02:00
brotli: update to 1.0.9.
This commit is contained in:
parent
1cdb91d4dd
commit
248950a273
2 changed files with 4 additions and 76 deletions
|
@ -1,73 +0,0 @@
|
||||||
From 5805f99a533a8f8118699c0100d8c102f3605f65 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Justin Ridgewell <justin@ridgewell.name>
|
|
||||||
Date: Mon, 12 Nov 2018 04:36:00 -0500
|
|
||||||
Subject: [PATCH] Ensure decompression consumes all input (#730)
|
|
||||||
|
|
||||||
* Ensure decompression consumes all input
|
|
||||||
|
|
||||||
If not, it's a corrupt stream.
|
|
||||||
|
|
||||||
* Use byte strings
|
|
||||||
---
|
|
||||||
python/_brotli.cc | 4 ++--
|
|
||||||
python/tests/decompress_test.py | 4 ++++
|
|
||||||
python/tests/decompressor_test.py | 9 +++++++++
|
|
||||||
3 files changed, 15 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git python/_brotli.cc python/_brotli.cc
|
|
||||||
index a6f925ef..5e1828e9 100644
|
|
||||||
--- python/_brotli.cc
|
|
||||||
+++ python/_brotli.cc
|
|
||||||
@@ -414,7 +414,7 @@ static BROTLI_BOOL decompress_stream(BrotliDecoderState* dec,
|
|
||||||
(*output).insert((*output).end(), buffer, buffer + buffer_length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- ok = result != BROTLI_DECODER_RESULT_ERROR;
|
|
||||||
+ ok = result != BROTLI_DECODER_RESULT_ERROR && !available_in;
|
|
||||||
|
|
||||||
Py_END_ALLOW_THREADS
|
|
||||||
return ok;
|
|
||||||
@@ -672,7 +672,7 @@ static PyObject* brotli_decompress(PyObject *self, PyObject *args, PyObject *key
|
|
||||||
if (available_out != 0)
|
|
||||||
output.insert(output.end(), next_out, next_out + available_out);
|
|
||||||
}
|
|
||||||
- ok = result == BROTLI_DECODER_RESULT_SUCCESS;
|
|
||||||
+ ok = result == BROTLI_DECODER_RESULT_SUCCESS && !available_in;
|
|
||||||
BrotliDecoderDestroyInstance(state);
|
|
||||||
|
|
||||||
Py_END_ALLOW_THREADS
|
|
||||||
diff --git python/tests/decompress_test.py python/tests/decompress_test.py
|
|
||||||
index 7a9e9e30..814e5633 100644
|
|
||||||
--- python/tests/decompress_test.py
|
|
||||||
+++ python/tests/decompress_test.py
|
|
||||||
@@ -31,6 +31,10 @@ def _test_decompress(self, test_data):
|
|
||||||
self._decompress(test_data)
|
|
||||||
self._check_decompression(test_data)
|
|
||||||
|
|
||||||
+ def test_garbage_appended(self):
|
|
||||||
+ with self.assertRaises(brotli.error):
|
|
||||||
+ brotli.decompress(brotli.compress(b'a') + b'a')
|
|
||||||
+
|
|
||||||
|
|
||||||
_test_utils.generate_test_methods(TestDecompress, for_decompression=True)
|
|
||||||
|
|
||||||
diff --git python/tests/decompressor_test.py python/tests/decompressor_test.py
|
|
||||||
index 99667bcd..05918ada 100644
|
|
||||||
--- python/tests/decompressor_test.py
|
|
||||||
+++ python/tests/decompressor_test.py
|
|
||||||
@@ -43,6 +43,15 @@ def _test_decompress(self, test_data):
|
|
||||||
self._decompress(test_data)
|
|
||||||
self._check_decompression(test_data)
|
|
||||||
|
|
||||||
+ def test_garbage_appended(self):
|
|
||||||
+ with self.assertRaises(brotli.error):
|
|
||||||
+ self.decompressor.process(brotli.compress(b'a') + b'a')
|
|
||||||
+
|
|
||||||
+ def test_already_finished(self):
|
|
||||||
+ self.decompressor.process(brotli.compress(b'a'))
|
|
||||||
+ with self.assertRaises(brotli.error):
|
|
||||||
+ self.decompressor.process(b'a')
|
|
||||||
+
|
|
||||||
|
|
||||||
_test_utils.generate_test_methods(TestDecompressor, for_decompression=True)
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Template file for 'brotli'
|
# Template file for 'brotli'
|
||||||
pkgname=brotli
|
pkgname=brotli
|
||||||
version=1.0.7
|
version=1.0.9
|
||||||
revision=2
|
revision=1
|
||||||
build_style=cmake
|
build_style=cmake
|
||||||
short_desc="Generic-purpose lossless compression algorithm"
|
short_desc="Generic-purpose lossless compression algorithm"
|
||||||
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="https://github.com/google/brotli"
|
homepage="https://github.com/google/brotli"
|
||||||
distfiles="https://github.com/google/${pkgname}/archive/v${version}.tar.gz"
|
distfiles="https://github.com/google/${pkgname}/archive/v${version}.tar.gz"
|
||||||
checksum=4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c
|
checksum=f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense LICENSE
|
vlicense LICENSE
|
||||||
|
@ -19,6 +19,7 @@ brotli-devel_package() {
|
||||||
depends="${sourcepkg}>=${version}_${revision}"
|
depends="${sourcepkg}>=${version}_${revision}"
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
vmove usr/include
|
vmove usr/include
|
||||||
|
vmove usr/lib/*.a
|
||||||
vmove usr/lib/*.so
|
vmove usr/lib/*.so
|
||||||
vmove usr/lib/pkgconfig
|
vmove usr/lib/pkgconfig
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue