diff options
Diffstat (limited to '')
-rw-r--r-- | source/l/libcaca/70.patch | 84 | ||||
-rw-r--r-- | source/l/libcaca/libcaca-0.99.beta20-CVE-2022-0856.patch | 38 | ||||
-rwxr-xr-x | source/l/libcaca/libcaca.SlackBuild | 12 | ||||
-rw-r--r-- | source/l/libcaca/libcaca.git.20211207.patch | 188 | ||||
-rw-r--r-- | source/l/libcaca/libcaca.url | 1 | ||||
-rw-r--r-- | source/l/libcue/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch | 24 | ||||
-rwxr-xr-x | source/l/libcue/libcue.SlackBuild | 4 |
7 files changed, 322 insertions, 29 deletions
diff --git a/source/l/libcaca/70.patch b/source/l/libcaca/70.patch new file mode 100644 index 000000000..eacf75824 --- /dev/null +++ b/source/l/libcaca/70.patch @@ -0,0 +1,84 @@ +From afacac2cf7dfad8015c059a96046d9c2fa34632f Mon Sep 17 00:00:00 2001 +From: Johannes Kauffmann <johanneskauffmann@hotmail.com> +Date: Sun, 18 Sep 2022 17:31:19 +0200 +Subject: [PATCH 1/3] common-image: avoid implicit function declaration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +common-image.c: In function ‘load_image’: +common-image.c:164:18: warning: implicit declaration of function ‘_caca_alloc2d’ [-Wimplicit-function-declaration] + 164 | im->pixels = _caca_alloc2d(im->w, im->h, depth); + | ^~~~~~~~~~~~~ +--- + src/common-image.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/common-image.c b/src/common-image.c +index 7059bf40..d40eba12 100644 +--- a/src/common-image.c ++++ b/src/common-image.c +@@ -22,6 +22,7 @@ + #endif + + #include "caca.h" ++#include "caca_internals.h" + + #include "common-image.h" + + +From f57b0d65cfaac5f1fbdc75458170e102f57a8dfa Mon Sep 17 00:00:00 2001 +From: Johannes Kauffmann <johanneskauffmann@hotmail.com> +Date: Sun, 18 Sep 2022 17:52:40 +0200 +Subject: [PATCH 2/3] caca: avoid nested externs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +common-image.c:164:18: warning: nested extern declaration of ‘_caca_alloc2d’ [-Wnested-externs] +--- + caca/caca.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/caca/caca.c b/caca/caca.c +index 327a8f9f..a9f461d8 100644 +--- a/caca/caca.c ++++ b/caca/caca.c +@@ -284,7 +284,7 @@ char const * caca_get_version(void) + * XXX: The following functions are private. + */ + +-extern void *_caca_alloc2d(size_t width, size_t height, size_t elem_size) ++void *_caca_alloc2d(size_t width, size_t height, size_t elem_size) + { + if (width == 0 || height == 0 || elem_size == 0 || SIZE_MAX / width / height < elem_size) + return NULL; + +From 9683d1f7efe316b1e6113b65c6fff40671d35632 Mon Sep 17 00:00:00 2001 +From: Johannes Kauffmann <johanneskauffmann@hotmail.com> +Date: Sun, 18 Sep 2022 18:01:31 +0200 +Subject: [PATCH 3/3] caca_internals: export _caca_alloc2d + +It is used by the image viewer: + +/usr/bin/ld: img2txt-common-image.o: in function `load_image': +../../src/common-image.c:164: undefined reference to `_caca_alloc2d' + +Fixes #59. +--- + caca/caca_internals.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/caca/caca_internals.h b/caca/caca_internals.h +index 7b74b9e9..0bd7f6c8 100644 +--- a/caca/caca_internals.h ++++ b/caca/caca_internals.h +@@ -268,7 +268,7 @@ extern int _caca_pop_event(caca_display_t *, caca_privevent_t *); + extern void _caca_set_term_title(char const *); + + /* Internal memory function */ +-extern void *_caca_alloc2d(size_t width, size_t height, size_t elem_size); ++__extern void *_caca_alloc2d(size_t width, size_t height, size_t elem_size); + + /* Profiling functions */ + #if defined PROF diff --git a/source/l/libcaca/libcaca-0.99.beta20-CVE-2022-0856.patch b/source/l/libcaca/libcaca-0.99.beta20-CVE-2022-0856.patch new file mode 100644 index 000000000..092af0643 --- /dev/null +++ b/source/l/libcaca/libcaca-0.99.beta20-CVE-2022-0856.patch @@ -0,0 +1,38 @@ +From d33a9ca2b7e9f32483c1aee4c3944c56206d456b Mon Sep 17 00:00:00 2001 +From: Josef Moellers <jmoellers@suse.de> +Date: Fri, 18 Mar 2022 11:52:22 +0100 +Subject: [PATCH] Prevent a divide-by-zero by checking for a zero width or + height. + +--- + src/img2txt.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/img2txt.c b/src/img2txt.c +index b8a25899..b9d5ba24 100644 +--- a/src/img2txt.c ++++ b/src/img2txt.c +@@ -177,7 +177,13 @@ int main(int argc, char **argv) + } + + /* Assume a 6×10 font */ +- if(!cols && !lines) ++ if(!i->w || !i->h) ++ { ++ fprintf(stderr, "%s: image size is 0\n", argv[0]); ++ lines = 0; ++ cols = 0; ++ } ++ else if(!cols && !lines) + { + cols = 60; + lines = cols * i->h * font_width / i->w / font_height; +@@ -214,7 +220,7 @@ int main(int argc, char **argv) + export = caca_export_canvas_to_memory(cv, format?format:"ansi", &len); + if(!export) + { +- fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format); ++ fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format?format:"ansi"); + } + else + { diff --git a/source/l/libcaca/libcaca.SlackBuild b/source/l/libcaca/libcaca.SlackBuild index 6c1ff0d30..6c039313c 100755 --- a/source/l/libcaca/libcaca.SlackBuild +++ b/source/l/libcaca/libcaca.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2006, 2007, 2008, 2009, 2010, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2006, 2007, 2008, 2009, 2010, 2017, 2018, 2023 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=libcaca VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-11} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -78,7 +78,15 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Fix build failure: +cat $CWD/libcaca.git.20211207.patch | patch -p1 --verbose || exit 1 +cat $CWD/70.patch | patch -p1 --verbose || exit 1 + +# Fix crash bug: +cat $CWD/libcaca-0.99.beta20-CVE-2022-0856.patch | patch -p1 --verbose || exit 1 + # Configure: +autoreconf -vif CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ diff --git a/source/l/libcaca/libcaca.git.20211207.patch b/source/l/libcaca/libcaca.git.20211207.patch new file mode 100644 index 000000000..404369e43 --- /dev/null +++ b/source/l/libcaca/libcaca.git.20211207.patch @@ -0,0 +1,188 @@ +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/caca_internals.h libcaca-0.99.beta20/caca/caca_internals.h +--- libcaca-0.99.beta20.orig/caca/caca_internals.h 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/caca_internals.h 2021-12-07 03:03:53.000000000 -0600 +@@ -26,6 +26,13 @@ + # define MAX_DIRTY_COUNT 8 + #endif + ++#undef __extern ++#if defined CACA_ENABLE_VISIBILITY ++# define __extern extern __attribute__((visibility("default"))) ++#else ++# define __extern extern ++#endif ++ + struct caca_frame + { + /* Frame size */ +@@ -116,7 +123,7 @@ + int conio_install(caca_display_t *); + #endif + #if defined(USE_GL) +-int gl_install(caca_display_t *); ++__extern int gl_install(caca_display_t *); + #endif + #if defined(USE_NCURSES) + int ncurses_install(caca_display_t *); +@@ -133,7 +140,7 @@ + int win32_install(caca_display_t *); + #endif + #if defined(USE_X11) +-int x11_install(caca_display_t *); ++__extern int x11_install(caca_display_t *); + #endif + + /* Timer structure */ +@@ -252,8 +259,9 @@ + /* Internal event functions */ + extern void _caca_handle_resize(caca_display_t *); + #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) +-extern void _push_event(caca_display_t *, caca_privevent_t *); +-extern int _pop_event(caca_display_t *, caca_privevent_t *); ++/* Expose this with ‘__extern’ because the GL driver uses it */ ++__extern void _caca_push_event(caca_display_t *, caca_privevent_t *); ++extern int _caca_pop_event(caca_display_t *, caca_privevent_t *); + #endif + + /* Internal window functions */ +@@ -269,4 +277,6 @@ + extern void _caca_fini_stat(struct caca_stat *); + #endif + ++#undef __extern ++ + #endif /* __CACA_INTERNALS_H__ */ +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/driver/conio.c libcaca-0.99.beta20/caca/driver/conio.c +--- libcaca-0.99.beta20.orig/caca/driver/conio.c 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/driver/conio.c 2021-12-07 03:03:53.000000000 -0600 +@@ -151,7 +151,7 @@ + + release = *ev; + release.type = CACA_EVENT_KEY_RELEASE; +- _push_event(dp, &release); ++ _caca_push_event(dp, &release); + + return 1; + } +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/driver/gl.c libcaca-0.99.beta20/caca/driver/gl.c +--- libcaca-0.99.beta20.orig/caca/driver/gl.c 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/driver/gl.c 2021-12-07 03:03:53.000000000 -0600 +@@ -374,7 +374,7 @@ + + if(dp->drv.p->mouse_clicked) + { +- _push_event(dp, ev); ++ _caca_push_event(dp, ev); + ev->type = CACA_EVENT_MOUSE_PRESS; + ev->data.mouse.button = dp->drv.p->mouse_button; + dp->drv.p->mouse_clicked = 0; +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/driver/ncurses.c libcaca-0.99.beta20/caca/driver/ncurses.c +--- libcaca-0.99.beta20.orig/caca/driver/ncurses.c 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/driver/ncurses.c 2021-12-07 03:03:53.000000000 -0600 +@@ -482,9 +482,9 @@ + switch(mevent.bstate) + { + #define PRESS(x) ev->data.mouse.button = x; \ +- ev->type = CACA_EVENT_MOUSE_PRESS; _push_event(dp, ev) ++ ev->type = CACA_EVENT_MOUSE_PRESS; _caca_push_event(dp, ev) + #define RELEASE(x) ev->data.mouse.button = x; \ +- ev->type = CACA_EVENT_MOUSE_RELEASE; _push_event(dp, ev) ++ ev->type = CACA_EVENT_MOUSE_RELEASE; _caca_push_event(dp, ev) + #define CLICK(x) PRESS(x); RELEASE(x) + case BUTTON1_PRESSED: PRESS(1); break; + case BUTTON1_RELEASED: RELEASE(1); break; +@@ -530,7 +530,7 @@ + } + + if(dp->mouse.x == mevent.x && dp->mouse.y == mevent.y) +- return _pop_event(dp, ev); ++ return _caca_pop_event(dp, ev); + + dp->mouse.x = mevent.x; + dp->mouse.y = mevent.y; +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/driver/slang.c libcaca-0.99.beta20/caca/driver/slang.c +--- libcaca-0.99.beta20.orig/caca/driver/slang.c 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/driver/slang.c 2021-12-07 03:03:53.000000000 -0600 +@@ -403,12 +403,12 @@ + + ev->data.mouse.button = button; + ev->type = CACA_EVENT_MOUSE_PRESS; +- _push_event(dp, ev); ++ _caca_push_event(dp, ev); + ev->type = CACA_EVENT_MOUSE_RELEASE; +- _push_event(dp, ev); ++ _caca_push_event(dp, ev); + + if(dp->mouse.x == x && dp->mouse.y == y) +- return _pop_event(dp, ev); ++ return _caca_pop_event(dp, ev); + + dp->mouse.x = x; + dp->mouse.y = y; +diff -u -r --new-file libcaca-0.99.beta20.orig/caca/event.c libcaca-0.99.beta20/caca/event.c +--- libcaca-0.99.beta20.orig/caca/event.c 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/caca/event.c 2021-12-07 03:03:53.000000000 -0600 +@@ -380,7 +380,7 @@ + && dp->events.autorepeat_ticks > AUTOREPEAT_THRESHOLD + && dp->events.autorepeat_ticks > AUTOREPEAT_RATE) + { +- _push_event(dp, ev); ++ _caca_push_event(dp, ev); + dp->events.autorepeat_ticks -= AUTOREPEAT_RATE; + *ev = dp->events.last_key_event; + return 1; +@@ -403,7 +403,7 @@ + && (dp->events.last_key_ticks > AUTOREPEAT_THRESHOLD + || (ev->type & CACA_EVENT_KEY_PRESS))) + { +- _push_event(dp, ev); ++ _caca_push_event(dp, ev); + *ev = dp->events.last_key_event; + ev->type = CACA_EVENT_KEY_RELEASE; + dp->events.last_key_event.type = CACA_EVENT_NONE; +@@ -425,7 +425,7 @@ + static int _lowlevel_event(caca_display_t *dp, caca_privevent_t *ev) + { + #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) +- int ret = _pop_event(dp, ev); ++ int ret = _caca_pop_event(dp, ev); + + if(ret) + return ret; +@@ -435,7 +435,7 @@ + } + + #if defined(USE_SLANG) || defined(USE_NCURSES) || defined(USE_CONIO) || defined(USE_GL) +-void _push_event(caca_display_t *dp, caca_privevent_t *ev) ++void _caca_push_event(caca_display_t *dp, caca_privevent_t *ev) + { + if(!ev->type || dp->events.queue == EVENTBUF_LEN) + return; +@@ -443,7 +443,7 @@ + dp->events.queue++; + } + +-int _pop_event(caca_display_t *dp, caca_privevent_t *ev) ++int _caca_pop_event(caca_display_t *dp, caca_privevent_t *ev) + { + int i; + +diff -u -r --new-file libcaca-0.99.beta20.orig/configure.ac libcaca-0.99.beta20/configure.ac +--- libcaca-0.99.beta20.orig/configure.ac 2021-10-19 08:58:30.000000000 -0500 ++++ libcaca-0.99.beta20/configure.ac 2021-12-07 03:03:53.000000000 -0600 +@@ -269,7 +269,6 @@ + [ac_cv_my_have_cocoa="yes"]) + CFLAGS="$save_CFLAGS" + if test "${ac_cv_my_have_cocoa}" = "yes"; then +- [[[ "$target_os" =~ [0-9]+ ]]] && darwin_ver="${BASH_REMATCH[[0]]}" + case x${target} in + xpowerpc*darwin*) + # 10.3 needed to link with X11 +@@ -297,6 +296,7 @@ + esac + CC="${CC:-gcc-${GCC_VERSION}}" + CXX="${CXX:-g++-${GCC_VERSION}}" ++ darwin_ver="$(echo "${target_os}" | sed -ne 's/[^0-9]*\([0-9]\+\).*/\1/p')" + if [[ "$darwin_ver" -lt "13" ]]; then + MACOSX_SDK_FRAMEWORKS="${MACOSX_SDK_FRAMEWORKS:--F${MACOSX_SDK}/System/Library/Frameworks}" + CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}" diff --git a/source/l/libcaca/libcaca.url b/source/l/libcaca/libcaca.url new file mode 100644 index 000000000..6bb713dea --- /dev/null +++ b/source/l/libcaca/libcaca.url @@ -0,0 +1 @@ +https://github.com/cacalabs/libcaca diff --git a/source/l/libcue/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch b/source/l/libcue/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch deleted file mode 100644 index b38727fdc..000000000 --- a/source/l/libcue/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch +++ /dev/null @@ -1,24 +0,0 @@ -From fdf72c8bded8d24cfa0608b8e97f2eed210a920e Mon Sep 17 00:00:00 2001 -From: Kevin Backhouse <kevinbackhouse@github.com> -Date: Wed, 27 Sep 2023 20:22:43 +0100 -Subject: [PATCH] Check that the array index isn't negative. This fixes - CVE-2023-43641. - -Signed-off-by: Kevin Backhouse <kevinbackhouse@github.com> ---- - cd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/cd.c b/cd.c -index cf77a18..4bbea19 100644 ---- a/cd.c -+++ b/cd.c -@@ -339,7 +339,7 @@ track_get_rem(const Track* track) - - void track_set_index(Track *track, int i, long ind) - { -- if (i > MAXINDEX) { -+ if (i < 0 || i > MAXINDEX) { - fprintf(stderr, "too many indexes\n"); - return; - } diff --git a/source/l/libcue/libcue.SlackBuild b/source/l/libcue/libcue.SlackBuild index d5b983e41..1df3c6a7a 100755 --- a/source/l/libcue/libcue.SlackBuild +++ b/source/l/libcue/libcue.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=libcue VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-4} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -85,8 +85,6 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ -cat $CWD/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch | patch -p1 --verbose || exit 1 - # Configure, build, and install: mkdir cmake-build cd cmake-build |