mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-06 04:46:42 +02:00
community/sox: backport a few CVEs
Thanks to Arch Linux for doing most of the hard work Fixes #10523
This commit is contained in:
parent
5668fe11fb
commit
86d8165dab
@ -3,7 +3,7 @@
|
||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||
pkgname=sox
|
||||
pkgver=14.4.2
|
||||
pkgrel=4
|
||||
pkgrel=5
|
||||
pkgdesc="The Swiss Army knife of sound processing tools"
|
||||
url="http://sox.sourceforge.net/"
|
||||
arch="all"
|
||||
@ -15,13 +15,50 @@ makedepends="ffmpeg-dev libao-dev libvorbis-dev libogg-dev lame-dev
|
||||
"
|
||||
subpackages="$pkgname-static $pkgname-doc $pkgname-dev"
|
||||
source="https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz
|
||||
sox-uclibc.patch
|
||||
sox-dynamic.patch
|
||||
CVE-2017-15371.patch::https://github.com/mansr/sox/commit/818bdd0.patch
|
||||
CVE-2017-11358.patch::https://github.com/mansr/sox/commit/6cb44a4.patch
|
||||
CVE-2017-15370.patch::https://github.com/mansr/sox/commit/ef3d8be.patch
|
||||
CVE-2017-11332.patch::https://github.com/mansr/sox/commit/7405bca.patch
|
||||
CVE-2017-11359.patch::https://github.com/mansr/sox/commit/8b590b3.patch
|
||||
CVE-2017-15372.patch::https://github.com/mansr/sox/commit/001c337.patch
|
||||
CVE-2017-15642.patch::https://github.com/mansr/sox/commit/0be259e.patch
|
||||
CVE-2017-18189.patch
|
||||
update-exported-symbol-list.patch
|
||||
add-destdir.patch
|
||||
cleanup-lsx_malloc.patch
|
||||
CVE-2019-8354.patch
|
||||
CVE-2019-8355.patch
|
||||
CVE-2019-8356.patch
|
||||
CVE-2019-8357.patch
|
||||
sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch
|
||||
fix-musl.patch
|
||||
"
|
||||
|
||||
# secfixes
|
||||
# 14.4.2-r5:
|
||||
# - CVE-2017-13571
|
||||
# - CVE-2017-11358
|
||||
# - CVE-2017-15370
|
||||
# - CVE-2017-11332
|
||||
# - CVE-2017-11359
|
||||
# - CVE-2017-15372
|
||||
# - CVE-2017-13642
|
||||
# - CVE-2017-18189
|
||||
# - CVE-2019-8354
|
||||
# - CVE-2019-8355
|
||||
# - CVE-2019-8356
|
||||
# - CVE-2019-8357
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# Fix man page installation
|
||||
sed -e 's|man1/sox.1 soxeffect.7|man1/sox.1.gz soxeffect.7.gz|' \
|
||||
-i Makefile.in
|
||||
|
||||
# test fails with CVE-2017-11359.patch
|
||||
sed -e '/hcom/d' -i src/tests.sh
|
||||
|
||||
autoreconf -vif
|
||||
}
|
||||
|
||||
@ -47,6 +84,20 @@ package() {
|
||||
rm "$pkgdir"/usr/lib/sox/*.a
|
||||
}
|
||||
sha512sums="b5c6203f4f5577503a034fe5b3d6a033ee97fe4d171c533933e2b036118a43a14f97c9668433229708609ccf9ee16abdeca3fc7501aa0aafe06baacbba537eca sox-14.4.2.tar.gz
|
||||
08c55a0de96733e10544d450f39c2205b4057b9fc024503ec97b1906a075752ee8a4b0a1b4c5bbad2eebec17bcf8d069b22d243a63d28b77c23d545efcca6aec sox-uclibc.patch
|
||||
3950834db26faa0523006c6fd8e0769d080518f127d345c8ec9bf53e9db8a6bd67cd724f0f86492aaf9ce6ede2dfbde167049768f35c14ef3c2b96e7e00302b6 sox-dynamic.patch
|
||||
aea1bcfdddd315d05654814e386512f0254d1707564a8370d6b2a8a2d12ecb527a7a566da8f2cfa9f0ee99369fab0f19819263d0d74de0616c9175362965e04c sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch"
|
||||
9f61fc979d0e0232aa2004a455a139950ceb998338577b94cd3bebfdf230896bde9765f9afef1af515ae0679b3afd245142027de3b7ce87eced3fbdb86558668 CVE-2017-15371.patch
|
||||
b2a096659cc98bd50322441d3611e607b71c54025feaf7c2acc322fff8c0ef5a83f06bef31099c4adf1794009b050a3f2dca71c7926892c60081261384891ac4 CVE-2017-11358.patch
|
||||
e5c079f8e8e4603e068a092db86ec6dea4da395f75fb4bfa284736edce2d8ea3441deda51ca7dce8865e1ac5914cdf9c6767ed74203726f26992e9d76f4d8b0b CVE-2017-15370.patch
|
||||
8c26bea077b503c8ec420880539f2a6e275d2b3c26eb5b4c5af38aae16b258a29ceb946aeb2252e47aeea22e5b6513c628a7ee3eb3d201d6fa541456b16bd399 CVE-2017-11332.patch
|
||||
6fb075c09cfedaec6bb6760ba2e0d55446478c8e2873884b6a940d42f44ad8e840809f8b31b59ff3d40307dd48d74dadf809859dfef190269da8800185b462a6 CVE-2017-11359.patch
|
||||
b1936686a7dff2b42629d05cb59cfdb86c2a42ef843fe0cd031607d1c7174479ed8cfc0d5c6ffd3be80c9c20894dd919547e8bd861ed5b49d596ee89a19db372 CVE-2017-15372.patch
|
||||
e44a2327a8808bf94acb8db1d8ea13f77bbe0600be47079b7c77dab3daab44a67c3ca9be93b32db6807c2c96c6b67529884d38bf03d02dda6be04794e711cb71 CVE-2017-15642.patch
|
||||
f67e5c2ab0ef358af137685d5ac9efa4595f5a607b72a10e706fb2bd5f7bfcf22a15af950b0592893e849243353765d0adc3b2e9f5bef1a84ae4023e16f931ff CVE-2017-18189.patch
|
||||
71147aff997e647afada2ca4f837e525133970c3420a67784e42e0ebd8b08bc063b20b3e6c72323c6e5980956946c9a6e1222e7ff0249587987bf863f4294da7 update-exported-symbol-list.patch
|
||||
1703f3bb21cd2553929cb1e625c6d537ea92ba7873252f4e3738795ae801b3cf887ca27823eda59466f27faa50e318817f63add7b87051531ab5381e71787552 add-destdir.patch
|
||||
c9aaaf8a75675cadeedb7db7660f6e438946302a48b1d7ed66ca2e5beb3e7303fd94539c97eddf4c049a761406d29ed78dcadfac9bb851f701e26d5031875042 cleanup-lsx_malloc.patch
|
||||
345132037594513a74fb875634408da1748ef005506835dd248e2e57918a72c343967c5f5316ca8bcc5967fc2d1e0df4026b9e17616d5d8e405ead0336911bca CVE-2019-8354.patch
|
||||
1d3d10e7d598ccddeda9138268d8fb86ac253a61e7ee980feb6c0c4da16d72a2b27bcf6fb078334c1a90e8e6ea031c33eedf304999a9f5ef18c6d9594b2603aa CVE-2019-8355.patch
|
||||
8bc3fe9800a878bd9920937321dd75f0a19328dd6dcc88bba9c30e7ac12b2ba3a1d53f0e8e3ee3e0bbd42e953590f2e96c3c64e287b58c646bacbc69362917fa CVE-2019-8356.patch
|
||||
8890ff942e25e94c3458ed5e1f5e587e779b3be34d7da2d3fbd5b9b8cc631738c5c76a0c25a7a2be6a7fe05c60b8efb6f784d544f573b8354c6b2cc3b573d066 CVE-2019-8357.patch
|
||||
aea1bcfdddd315d05654814e386512f0254d1707564a8370d6b2a8a2d12ecb527a7a566da8f2cfa9f0ee99369fab0f19819263d0d74de0616c9175362965e04c sox-14.4.2-hcom_stopwrite_big_endian_bug_fix.patch
|
||||
7322b297bae36530756d44ca9b11db8f682e97f55e9ca51164d48713486d405121c9e6557bb1ea3739a61b9dccf19257dce806b28b363062d635abbc00d2d9f6 fix-musl.patch"
|
||||
|
||||
34
community/sox/CVE-2017-18189.patch
Normal file
34
community/sox/CVE-2017-18189.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 09d7388c8ad5701ed9c59d1d600ff6154b066397 Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Thu, 9 Nov 2017 11:45:10 +0000
|
||||
Subject: [PATCH] xa: validate channel count (CVE-2017-18189)
|
||||
|
||||
A corrupt header specifying zero channels would send read_channels()
|
||||
into an infinite loop. Prevent this by sanity checking the channel
|
||||
count in open_read(). Also add an upper bound to prevent overflow
|
||||
in multiplication.
|
||||
---
|
||||
src/xa.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/xa.c b/src/xa.c
|
||||
index 81a76772..9fc086ec 100644
|
||||
--- a/src/xa.c
|
||||
+++ b/src/xa.c
|
||||
@@ -143,6 +143,12 @@ static int startread(sox_format_t * ft)
|
||||
lsx_report("User options overriding rate read in .xa header");
|
||||
}
|
||||
|
||||
+ if (ft->signal.channels == 0 || ft->signal.channels > UINT16_MAX) {
|
||||
+ lsx_fail_errno(ft, SOX_EFMT, "invalid channel count %d",
|
||||
+ ft->signal.channels);
|
||||
+ return SOX_EOF;
|
||||
+ }
|
||||
+
|
||||
/* Check for supported formats */
|
||||
if (ft->encoding.bits_per_sample != 16) {
|
||||
lsx_fail_errno(ft, SOX_EFMT, "%d-bit sample resolution not supported.",
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
29
community/sox/CVE-2019-8354.patch
Normal file
29
community/sox/CVE-2019-8354.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From f70911261a84333b077c29908e1242f69d7439eb Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Wed, 24 Apr 2019 14:57:34 +0100
|
||||
Subject: [PATCH] fix possible buffer size overflow in lsx_make_lpf()
|
||||
(CVE-2019-8354)
|
||||
|
||||
The multiplication in the size argument malloc() might overflow,
|
||||
resulting in a small buffer being allocated. Use calloc() instead.
|
||||
---
|
||||
src/effects_i_dsp.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/effects_i_dsp.c b/src/effects_i_dsp.c
|
||||
index a979b501..e32dfa05 100644
|
||||
--- a/src/effects_i_dsp.c
|
||||
+++ b/src/effects_i_dsp.c
|
||||
@@ -357,7 +357,7 @@ double * lsx_make_lpf(int num_taps, double Fc, double beta, double rho,
|
||||
double scale, sox_bool dc_norm)
|
||||
{
|
||||
int i, m = num_taps - 1;
|
||||
- double * h = malloc(num_taps * sizeof(*h)), sum = 0;
|
||||
+ double * h = calloc(num_taps, sizeof(*h)), sum = 0;
|
||||
double mult = scale / lsx_bessel_I_0(beta), mult1 = 1 / (.5 * m + rho);
|
||||
assert(Fc >= 0 && Fc <= 1);
|
||||
lsx_debug("make_lpf(n=%i Fc=%.7g β=%g ρ=%g dc-norm=%i scale=%g)", num_taps, Fc, beta, rho, dc_norm, scale);
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
69
community/sox/CVE-2019-8355.patch
Normal file
69
community/sox/CVE-2019-8355.patch
Normal file
@ -0,0 +1,69 @@
|
||||
From f8587e2d50dad72d40453ac1191c539ee9e50381 Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Wed, 24 Apr 2019 17:39:45 +0100
|
||||
Subject: [PATCH] fix possible overflow in lsx_(re)valloc() size calculation
|
||||
(CVE-2019-8355)
|
||||
|
||||
---
|
||||
src/Makefile.am | 2 +-
|
||||
src/xmalloc.c | 10 ++++++++++
|
||||
src/xmalloc.h | 5 +++--
|
||||
3 files changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 42573ec5..d5f6d125 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -95,7 +95,7 @@ libsox_la_LIBADD += @GOMP_LIBS@
|
||||
|
||||
libsox_la_CFLAGS = @WARN_CFLAGS@
|
||||
libsox_la_LDFLAGS = @APP_LDFLAGS@ -version-info @SHLIB_VERSION@ \
|
||||
- -export-symbols-regex '^(sox_.*|lsx_(([cm]|re)alloc|check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|rewind|seeki|sigfigs3p?|strcasecmp|strdup|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
+ -export-symbols-regex '^(sox_.*|lsx_(([cm]|re)alloc.*|check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|rewind|seeki|sigfigs3p?|strcasecmp|strdup|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
|
||||
if HAVE_WIN32_LTDL
|
||||
libsox_la_SOURCES += win32-ltdl.c win32-ltdl.h
|
||||
diff --git a/src/xmalloc.c b/src/xmalloc.c
|
||||
index 56fe6944..72c9ea4d 100644
|
||||
--- a/src/xmalloc.c
|
||||
+++ b/src/xmalloc.c
|
||||
@@ -57,6 +57,16 @@ void *lsx_calloc(size_t n, size_t size)
|
||||
return lsx_checkptr(calloc(n + !n, size + !size));
|
||||
}
|
||||
|
||||
+void *lsx_realloc_array(void *p, size_t n, size_t size)
|
||||
+{
|
||||
+ if (n > (size_t)-1 / size) {
|
||||
+ lsx_fail("malloc size overflow");
|
||||
+ exit(2);
|
||||
+ }
|
||||
+
|
||||
+ return lsx_realloc(p, n * size);
|
||||
+}
|
||||
+
|
||||
char *lsx_strdup(const char *s)
|
||||
{
|
||||
return lsx_checkptr(strdup(s));
|
||||
diff --git a/src/xmalloc.h b/src/xmalloc.h
|
||||
index 92ac64d9..21ff6630 100644
|
||||
--- a/src/xmalloc.h
|
||||
+++ b/src/xmalloc.h
|
||||
@@ -25,11 +25,12 @@
|
||||
|
||||
LSX_RETURN_VALID void *lsx_malloc(size_t size);
|
||||
LSX_RETURN_VALID void *lsx_calloc(size_t n, size_t size);
|
||||
+LSX_RETURN_VALID void *lsx_realloc_array(void *p, size_t n, size_t size);
|
||||
LSX_RETURN_VALID char *lsx_strdup(const char *s);
|
||||
|
||||
#define lsx_Calloc(v,n) v = lsx_calloc(n,sizeof(*(v)))
|
||||
#define lsx_memdup(p,s) ((p)? memcpy(lsx_malloc(s), p, s) : NULL)
|
||||
-#define lsx_valloc(v,n) v = lsx_malloc((n)*sizeof(*(v)))
|
||||
-#define lsx_revalloc(v,n) v = lsx_realloc(v, (n)*sizeof(*(v)))
|
||||
+#define lsx_valloc(v,n) v = lsx_realloc_array(NULL, n, sizeof(*(v)))
|
||||
+#define lsx_revalloc(v,n) v = lsx_realloc_array(v, n, sizeof(*(v)))
|
||||
|
||||
#endif
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
92
community/sox/CVE-2019-8356.patch
Normal file
92
community/sox/CVE-2019-8356.patch
Normal file
@ -0,0 +1,92 @@
|
||||
From b7883ae1398499daaa926ae6621f088f0f531ed8 Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Wed, 24 Apr 2019 16:56:42 +0100
|
||||
Subject: [PATCH] fft4g: bail if size too large (CVE-2019-8356)
|
||||
|
||||
Prevent overflowing of fixed-size buffers in bitrv2() and bitrv2conj()
|
||||
if the transform size is too large.
|
||||
---
|
||||
src/fft4g.c | 18 ++++++++++++++++++
|
||||
src/fft4g.h | 2 ++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/fft4g.c b/src/fft4g.c
|
||||
index 38a8bcc0..88a2a7ec 100644
|
||||
--- a/src/fft4g.c
|
||||
+++ b/src/fft4g.c
|
||||
@@ -322,6 +322,9 @@ static void rftfsub(int n, double *a, int nc, double const *c);
|
||||
|
||||
void cdft(int n, int isgn, double *a, int *ip, double *w)
|
||||
{
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
if (n > (ip[0] << 2)) {
|
||||
makewt(n >> 2, ip, w);
|
||||
}
|
||||
@@ -344,6 +347,9 @@ void rdft(int n, int isgn, double *a, int *ip, double *w)
|
||||
int nw, nc;
|
||||
double xi;
|
||||
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
nw = ip[0];
|
||||
if (n > (nw << 2)) {
|
||||
nw = n >> 2;
|
||||
@@ -384,6 +390,9 @@ void ddct(int n, int isgn, double *a, int *ip, double *w)
|
||||
int j, nw, nc;
|
||||
double xr;
|
||||
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
nw = ip[0];
|
||||
if (n > (nw << 2)) {
|
||||
nw = n >> 2;
|
||||
@@ -435,6 +444,9 @@ void ddst(int n, int isgn, double *a, int *ip, double *w)
|
||||
int j, nw, nc;
|
||||
double xr;
|
||||
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
nw = ip[0];
|
||||
if (n > (nw << 2)) {
|
||||
nw = n >> 2;
|
||||
@@ -486,6 +498,9 @@ void dfct(int n, double *a, double *t, int *ip, double *w)
|
||||
int j, k, l, m, mh, nw, nc;
|
||||
double xr, xi, yr, yi;
|
||||
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
nw = ip[0];
|
||||
if (n > (nw << 3)) {
|
||||
nw = n >> 3;
|
||||
@@ -576,6 +591,9 @@ void dfst(int n, double *a, double *t, int *ip, double *w)
|
||||
int j, k, l, m, mh, nw, nc;
|
||||
double xr, xi, yr, yi;
|
||||
|
||||
+ if (n > FFT4G_MAX_SIZE)
|
||||
+ return;
|
||||
+
|
||||
nw = ip[0];
|
||||
if (n > (nw << 3)) {
|
||||
nw = n >> 3;
|
||||
diff --git a/src/fft4g.h b/src/fft4g.h
|
||||
index 2b8051ca..95ee3413 100644
|
||||
--- a/src/fft4g.h
|
||||
+++ b/src/fft4g.h
|
||||
@@ -13,6 +13,8 @@
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
+#define FFT4G_MAX_SIZE 262144
|
||||
+
|
||||
void lsx_cdft(int, int, double *, int *, double *);
|
||||
void lsx_rdft(int, int, double *, int *, double *);
|
||||
void lsx_ddct(int, int, double *, int *, double *);
|
||||
--
|
||||
2.22.0
|
||||
|
||||
29
community/sox/CVE-2019-8357.patch
Normal file
29
community/sox/CVE-2019-8357.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 2ce02fea7b350de9ddfbcf542ba4dd59a8ab255b Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Wed, 24 Apr 2019 15:08:51 +0100
|
||||
Subject: [PATCH] fix possible null pointer deref in lsx_make_lpf()
|
||||
(CVE-2019-8357)
|
||||
|
||||
If the buffer allocation fails, return NULL.
|
||||
---
|
||||
src/effects_i_dsp.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/effects_i_dsp.c b/src/effects_i_dsp.c
|
||||
index e32dfa05..88b1b390 100644
|
||||
--- a/src/effects_i_dsp.c
|
||||
+++ b/src/effects_i_dsp.c
|
||||
@@ -362,6 +362,9 @@ double * lsx_make_lpf(int num_taps, double Fc, double beta, double rho,
|
||||
assert(Fc >= 0 && Fc <= 1);
|
||||
lsx_debug("make_lpf(n=%i Fc=%.7g β=%g ρ=%g dc-norm=%i scale=%g)", num_taps, Fc, beta, rho, dc_norm, scale);
|
||||
|
||||
+ if (!h)
|
||||
+ return NULL;
|
||||
+
|
||||
for (i = 0; i <= m / 2; ++i) {
|
||||
double z = i - .5 * m, x = z * M_PI, y = z * mult1;
|
||||
h[i] = x? sin(Fc * x) / x : Fc;
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
27
community/sox/add-destdir.patch
Normal file
27
community/sox/add-destdir.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 0d70a21c6f98575984c28f4e98a1fbf929195456 Mon Sep 17 00:00:00 2001
|
||||
From: Jiri Kucera <jkucera@redhat.com>
|
||||
Date: Thu, 25 Jan 2018 21:53:30 +0100
|
||||
Subject: [PATCH] make: add $(DESTDIR) in installcheck target [bug #302]
|
||||
|
||||
This ensures the proper sox binary is invoked during tests.
|
||||
---
|
||||
src/Makefile.am | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 7cceaafd..caf98645 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -194,6 +194,6 @@ loc:
|
||||
# would run the test suite, but an uninstalled libltdl build cannot
|
||||
# currently load its formats and effects, so the checks would fail.
|
||||
installcheck:
|
||||
- $(srcdir)/tests.sh --bindir=${bindir} --builddir=${builddir} --srcdir=${srcdir}
|
||||
- $(srcdir)/testall.sh --bindir=${bindir} --srcdir=${srcdir}
|
||||
+ $(srcdir)/tests.sh --bindir=$(DESTDIR)${bindir} --builddir=${builddir} --srcdir=${srcdir}
|
||||
+ $(srcdir)/testall.sh --bindir=$(DESTDIR)${bindir} --srcdir=${srcdir}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
94
community/sox/cleanup-lsx_malloc.patch
Normal file
94
community/sox/cleanup-lsx_malloc.patch
Normal file
@ -0,0 +1,94 @@
|
||||
From ccedd08802f62ed896f69d778e6a106d00f9ab58 Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Tue, 8 Dec 2015 22:52:41 +0000
|
||||
Subject: [PATCH] Clean up lsx_malloc() and friends
|
||||
|
||||
---
|
||||
src/Makefile.am | 2 +-
|
||||
src/xmalloc.c | 30 +++++++++++++++++++++++++-----
|
||||
src/xmalloc.h | 7 ++++---
|
||||
3 files changed, 30 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index cd44ae4d..42573ec5 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -95,7 +95,7 @@ libsox_la_LIBADD += @GOMP_LIBS@
|
||||
|
||||
libsox_la_CFLAGS = @WARN_CFLAGS@
|
||||
libsox_la_LDFLAGS = @APP_LDFLAGS@ -version-info @SHLIB_VERSION@ \
|
||||
- -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
+ -export-symbols-regex '^(sox_.*|lsx_(([cm]|re)alloc|check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|rewind|seeki|sigfigs3p?|strcasecmp|strdup|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
|
||||
if HAVE_WIN32_LTDL
|
||||
libsox_la_SOURCES += win32-ltdl.c win32-ltdl.h
|
||||
diff --git a/src/xmalloc.c b/src/xmalloc.c
|
||||
index 9bf15969..56fe6944 100644
|
||||
--- a/src/xmalloc.c
|
||||
+++ b/src/xmalloc.c
|
||||
@@ -20,6 +20,16 @@
|
||||
#include "sox_i.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
+static void *lsx_checkptr(void *ptr)
|
||||
+{
|
||||
+ if (!ptr) {
|
||||
+ lsx_fail("out of memory");
|
||||
+ exit(2);
|
||||
+ }
|
||||
+
|
||||
+ return ptr;
|
||||
+}
|
||||
+
|
||||
/* Resize an allocated memory area; abort if not possible.
|
||||
*
|
||||
* For malloc, `If the size of the space requested is zero, the behavior is
|
||||
@@ -34,10 +44,20 @@ void *lsx_realloc(void *ptr, size_t newsize)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- if ((ptr = realloc(ptr, newsize)) == NULL) {
|
||||
- lsx_fail("out of memory");
|
||||
- exit(2);
|
||||
- }
|
||||
+ return lsx_checkptr(realloc(ptr, newsize));
|
||||
+}
|
||||
+
|
||||
+void *lsx_malloc(size_t size)
|
||||
+{
|
||||
+ return lsx_checkptr(malloc(size + !size));
|
||||
+}
|
||||
+
|
||||
+void *lsx_calloc(size_t n, size_t size)
|
||||
+{
|
||||
+ return lsx_checkptr(calloc(n + !n, size + !size));
|
||||
+}
|
||||
|
||||
- return ptr;
|
||||
+char *lsx_strdup(const char *s)
|
||||
+{
|
||||
+ return lsx_checkptr(strdup(s));
|
||||
}
|
||||
diff --git a/src/xmalloc.h b/src/xmalloc.h
|
||||
index 9ee77f63..92ac64d9 100644
|
||||
--- a/src/xmalloc.h
|
||||
+++ b/src/xmalloc.h
|
||||
@@ -23,10 +23,11 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
-#define lsx_malloc(size) lsx_realloc(NULL, (size))
|
||||
-#define lsx_calloc(n,s) (((n)*(s))? memset(lsx_malloc((n)*(s)),0,(n)*(s)) : NULL)
|
||||
+LSX_RETURN_VALID void *lsx_malloc(size_t size);
|
||||
+LSX_RETURN_VALID void *lsx_calloc(size_t n, size_t size);
|
||||
+LSX_RETURN_VALID char *lsx_strdup(const char *s);
|
||||
+
|
||||
#define lsx_Calloc(v,n) v = lsx_calloc(n,sizeof(*(v)))
|
||||
-#define lsx_strdup(p) ((p)? strcpy((char *)lsx_malloc(strlen(p) + 1), p) : NULL)
|
||||
#define lsx_memdup(p,s) ((p)? memcpy(lsx_malloc(s), p, s) : NULL)
|
||||
#define lsx_valloc(v,n) v = lsx_malloc((n)*sizeof(*(v)))
|
||||
#define lsx_revalloc(v,n) v = lsx_realloc(v, (n)*sizeof(*(v)))
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
@ -1,14 +1,5 @@
|
||||
--- ./src/formats.c.orig 2013-02-17 12:19:38.318344596 +0000
|
||||
+++ ./src/formats.c 2013-02-17 12:50:31.560549872 +0000
|
||||
@@ -409,7 +409,7 @@
|
||||
#if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
|
||||
fp->_p -= PIPE_AUTO_DETECT_SIZE;
|
||||
fp->_r += PIPE_AUTO_DETECT_SIZE;
|
||||
-#elif defined __GLIBC__
|
||||
+#elif defined __GLIBC__ && ! defined __UCLIBC__
|
||||
fp->_IO_read_ptr = fp->_IO_read_base;
|
||||
#elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || defined _ISO_STDIO_ISO_H
|
||||
fp->_ptr = fp->_base;
|
||||
@@ -417,7 +417,7 @@
|
||||
/* To fix this #error, either simply remove the #error line and live without
|
||||
* file-type detection with pipes, or add support for your compiler in the
|
||||
@ -1,12 +0,0 @@
|
||||
diff -Naur sox-14.4.2-orig/src/Makefile.am sox-14.4.2/src/Makefile.am
|
||||
--- sox-14.4.2-orig/src/Makefile.am 2015-04-08 17:11:09.555343005 -0400
|
||||
+++ sox-14.4.2/src/Makefile.am 2015-04-08 17:11:25.115317153 -0400
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
libsox_la_CFLAGS = @WARN_CFLAGS@
|
||||
libsox_la_LDFLAGS = @APP_LDFLAGS@ -version-info @SHLIB_VERSION@ \
|
||||
- -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|fail_errno|filelength|find_(enum_(text|value)|file_extension)|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
+ -export-symbols-regex '^(sox_.*|lsx_(error|flush|check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|fail_errno|filelength|find_(enum_(text|value)|file_extension)|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
|
||||
if HAVE_WIN32_LTDL
|
||||
libsox_la_SOURCES += win32-ltdl.c win32-ltdl.h
|
||||
26
community/sox/update-exported-symbol-list.patch
Normal file
26
community/sox/update-exported-symbol-list.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From ec073861aa9c0f779a3741c456e4f97d59366ffb Mon Sep 17 00:00:00 2001
|
||||
From: Mans Rullgard <mans@mansr.com>
|
||||
Date: Sun, 5 Nov 2017 15:40:16 +0000
|
||||
Subject: [PATCH] make: update exported symbol list [bug #266]
|
||||
|
||||
---
|
||||
src/Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index caf98645..cd44ae4d 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -95,7 +95,7 @@ libsox_la_LIBADD += @GOMP_LIBS@
|
||||
|
||||
libsox_la_CFLAGS = @WARN_CFLAGS@
|
||||
libsox_la_LDFLAGS = @APP_LDFLAGS@ -version-info @SHLIB_VERSION@ \
|
||||
- -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|fail_errno|filelength|find_(enum_(text|value)|file_extension)|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
+ -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$'
|
||||
|
||||
if HAVE_WIN32_LTDL
|
||||
libsox_la_SOURCES += win32-ltdl.c win32-ltdl.h
|
||||
--
|
||||
2.22.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user