[vlc-commits] [Git][videolan/vlc][master] contrib: caca: apply upstream patch

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jul 3 13:29:43 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5888febf by Steve Lhomme at 2026-07-03T12:35:55+00:00
contrib: caca: apply upstream patch

To fix CVE-2026-42046 [^1].

[^1]: https://app.opencve.io/cve/CVE-2026-42046

- - - - -


2 changed files:

- + contrib/src/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
- contrib/src/caca/rules.mak


Changes:

=====================================
contrib/src/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
=====================================
@@ -0,0 +1,37 @@
+From fb77acff9ba6bb01d53940da34fb10f20b156a23 Mon Sep 17 00:00:00 2001
+From: Pascal Terjan <pterjan at mageia.org>
+Date: Sun, 12 Apr 2026 19:06:08 +0000
+Subject: [PATCH] Prevent undefined behaviour in overflow check
+
+Fixes #86
+---
+ caca/canvas.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/caca/canvas.c b/caca/canvas.c
+index 7beff5b8..62b72b72 100644
+--- a/caca/canvas.c
++++ b/caca/canvas.c
+@@ -26,6 +26,7 @@
+ #   if defined(HAVE_UNISTD_H)
+ #       include <unistd.h>
+ #   endif
++#   include <limits.h>
+ #endif
+ 
+ #include "caca.h"
+@@ -368,12 +369,12 @@ int caca_resize(caca_canvas_t *cv, int width, int height)
+     int x, y, f, old_width, old_height, old_size;
+ 
+     /* Check for overflow */
+-    int new_size = width * height;
+-    if (new_size < 0 || (width > 0 && new_size / width != height))
++    if (width != 0 && height > INT_MAX / width)
+     {
+         seterrno(EOVERFLOW);
+         return -1;
+     }
++    int new_size = width * height;
+ 
+     old_width = cv->width;
+     old_height = cv->height;


=====================================
contrib/src/caca/rules.mak
=====================================
@@ -28,6 +28,7 @@ caca: libcaca-$(CACA_VERSION).tar.gz .sum-caca
 	$(APPLY) $(SRC)/caca/0004-win32-use-CreateFile2-when-compiling-for-Win8.patch
 	$(APPLY) $(SRC)/caca/0005-canvas-use-GetCurrentProcessId-on-Windows.patch
 	$(APPLY) $(SRC)/caca/0006-stubs-include-winsock2.h-to-get-htons-htonl-declarat.patch
+	$(APPLY) $(SRC)/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
 	$(call pkg_static,"caca/caca.pc.in")
 	$(MOVE)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5888febf7e4c3f824dc2c8f23dbacc019e861c11

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5888febf7e4c3f824dc2c8f23dbacc019e861c11
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list