From 01d774d92097bb1775b397384160371a4e3ae7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 27 Aug 2020 07:05:05 +0700 Subject: [PATCH] xava: update to 0.6.3.0 (renamed from cava-gui) --- srcpkgs/cava-gui | 1 + .../patches/fix-missing__int16_t.patch | 23 ------------ srcpkgs/cava-gui/template | 21 ----------- ...01-GetInstallDir-fix-buffer-overflow.patch | 36 +++++++++++++++++++ srcpkgs/xava/template | 25 +++++++++++++ 5 files changed, 62 insertions(+), 44 deletions(-) create mode 120000 srcpkgs/cava-gui delete mode 100644 srcpkgs/cava-gui/patches/fix-missing__int16_t.patch delete mode 100644 srcpkgs/cava-gui/template create mode 100644 srcpkgs/xava/patches/0001-GetInstallDir-fix-buffer-overflow.patch create mode 100644 srcpkgs/xava/template diff --git a/srcpkgs/cava-gui b/srcpkgs/cava-gui new file mode 120000 index 00000000000..987273b2a47 --- /dev/null +++ b/srcpkgs/cava-gui @@ -0,0 +1 @@ +xava \ No newline at end of file diff --git a/srcpkgs/cava-gui/patches/fix-missing__int16_t.patch b/srcpkgs/cava-gui/patches/fix-missing__int16_t.patch deleted file mode 100644 index db130ece908..00000000000 --- a/srcpkgs/cava-gui/patches/fix-missing__int16_t.patch +++ /dev/null @@ -1,23 +0,0 @@ -Source: maxice8 -Upstream: no -Reason: fixes compilation with musl libc, and avoid using an internal implementation - ---- input/fifo.c -+++ input/fifo.c -@@ -1,6 +1,7 @@ - #include - #include - #include -+#include - #include - #include "fifo.h" - -@@ -27,7 +28,7 @@ void* input_fifo(void* data) - int t = 0; - //int size = 1024; - int bytes = 0; -- __int16_t buf[BUFSIZE / 2]; -+ int16_t buf[BUFSIZE / 2]; - struct timespec req = { .tv_sec = 0, .tv_nsec = 10000000 }; - - diff --git a/srcpkgs/cava-gui/template b/srcpkgs/cava-gui/template deleted file mode 100644 index 66f3b4aa3f7..00000000000 --- a/srcpkgs/cava-gui/template +++ /dev/null @@ -1,21 +0,0 @@ -# Template file for 'cava-gui' -pkgname=cava-gui -version=0.6.1.1 -revision=1 -wrksrc="xava-${version}" -build_style=cmake -hostmakedepends="automake libtool" -makedepends="SDL2-devel iniparser-devel ncurses-devel sndio-devel portaudio-devel" -short_desc="Console-based Audio Visualizer for ALSA (GUI branch)" -maintainer="nik123 " -license="MIT" -homepage="https://github.com/nikp123/xava" -distfiles="https://github.com/nikp123/xava/archive/${version}.tar.gz" -checksum=53704343b33025a0d4de552e96af67a5b5ab4f6efc8956296aee5a74bebb9bdf -conflicts=cava - -post_install() { - vlicense LICENSE - vmkdir usr/share/examples - vcopy example_files usr/share/examples/cava -} diff --git a/srcpkgs/xava/patches/0001-GetInstallDir-fix-buffer-overflow.patch b/srcpkgs/xava/patches/0001-GetInstallDir-fix-buffer-overflow.patch new file mode 100644 index 00000000000..8f7a1c0805f --- /dev/null +++ b/srcpkgs/xava/patches/0001-GetInstallDir-fix-buffer-overflow.patch @@ -0,0 +1,36 @@ +From 9748190a7c191ed21d551d816b91a7005c8ef51a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + +Date: Thu, 27 Aug 2020 07:38:26 +0700 +Subject: [PATCH] GetInstallDir: fix buffer overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +strlen(3) will return length of input, not including terminating NUL +character. And strcpy(3) will copy the included NUL character. +Thus, we'll get buffer overflow for 1 character. + +Fix it. + +Signed-off-by: Đoàn Trần Công Danh +--- + src/shared.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/shared.c src/shared.c +index 1738650..4c1ce31 100644 +--- src/shared.c ++++ src/shared.c +@@ -107,7 +107,7 @@ char *xavaGetInstallDir() { + path[strlen(path)-executableNameSize] = '\0'; + #else + // everything non-windows is simple as fuck, go look at the mess above +- const char *path = malloc(strlen(PREFIX"/share/"PACKAGE"/")); ++ const char *path = malloc(strlen(PREFIX"/share/"PACKAGE"/") + 1); + strcpy(path, PREFIX"/share/"PACKAGE"/"); + #endif + return path; +-- +2.28.0.461.g40977abb40 + diff --git a/srcpkgs/xava/template b/srcpkgs/xava/template new file mode 100644 index 00000000000..a112e8b1db9 --- /dev/null +++ b/srcpkgs/xava/template @@ -0,0 +1,25 @@ +# Template file for 'xava' +pkgname=xava +version=0.6.3.0 +revision=1 +build_style=cmake +hostmakedepends="automake libtool pkg-config" +makedepends="SDL2-devel iniparser-devel ncurses-devel sndio-devel portaudio-devel" +short_desc="X11 Audio Visualizer for ALSA" +maintainer="Orphaned " +license="MIT" +homepage="https://github.com/nikp123/xava" +distfiles="https://github.com/nikp123/xava/archive/${version}.tar.gz" +checksum=745da4f6690f58e29d9f20ca790b3f354a1f53ef810d4ab6b1027bcac7e62fbf + +post_install() { + vlicense LICENSE + vmkdir usr/share/examples + vcopy example_files/etc usr/share/examples/xava +} + +cava-gui_package() { + depends="xava" + short_desc+=" - transition package" + build_style=meta +}