commit:     8f8da0fb4fdb039c20dcbad2c36c03b1d03a9319
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Sun Jan  4 07:52:58 2026 +0000
Commit:     Nickolas Raymond Kaczynski <nrk <AT> disroot <DOT> org>
CommitDate: Sun Jan  4 07:55:01 2026 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8f8da0fb

dev-debug/gdb-dashboard: python 3.13, patch overflow

Signed-off-by: NRK <nrk <AT> disroot.org>

 .../gdb-dashboard-0.17.4-fix-buffer-overflow.patch | 34 ++++++++++++++++++++++
 ....17.4.ebuild => gdb-dashboard-0.17.4-r1.ebuild} |  6 ++--
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git 
a/dev-debug/gdb-dashboard/files/gdb-dashboard-0.17.4-fix-buffer-overflow.patch 
b/dev-debug/gdb-dashboard/files/gdb-dashboard-0.17.4-fix-buffer-overflow.patch
new file mode 100644
index 0000000000..d1ec1f375a
--- /dev/null
+++ 
b/dev-debug/gdb-dashboard/files/gdb-dashboard-0.17.4-fix-buffer-overflow.patch
@@ -0,0 +1,34 @@
+Ref: https://github.com/cyrus-and/gdb-dashboard/pull/342
+
+From b47be5e0563dec7d8d71bd5477d7c27bb1fda0c1 Mon Sep 17 00:00:00 2001
+From: Valentin Tunev <[email protected]>
+Date: Wed, 5 Nov 2025 21:59:17 +0200
+Subject: [PATCH] Fix buffer overflow in get_term_size()
+
+Use an 8-byte buffer, unpack the first 4 bytes for rows/cols, and
+include SystemError in the except clause to cover additional terminal
+errors.
+---
+ .gdbinit | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/.gdbinit b/.gdbinit
+index 3af237b..654f27d 100644
+--- a/.gdbinit
++++ b/.gdbinit
+@@ -612,11 +612,11 @@ class Dashboard(gdb.Command):
+             else:
+                 import termios
+                 import fcntl
+-                # first 2 shorts (4 byte) of struct winsize
+-                raw = fcntl.ioctl(fd, termios.TIOCGWINSZ, ' ' * 4)
+-                height, width = struct.unpack('hh', raw)
++                # struct winsize is 8 bytes, but we only need the first 2 
shorts (rows, cols)
++                raw = fcntl.ioctl(fd, termios.TIOCGWINSZ, b'\0' * 8)
++                height, width = struct.unpack('hh', raw[:4])
+                 return int(width), int(height)
+-        except (ImportError, OSError):
++        except (ImportError, OSError, SystemError):
+             # this happens when no curses library is found on windows or when
+             # the terminal is not properly configured
+             return 80, 24  # hardcoded fallback value

diff --git a/dev-debug/gdb-dashboard/gdb-dashboard-0.17.4.ebuild 
b/dev-debug/gdb-dashboard/gdb-dashboard-0.17.4-r1.ebuild
similarity index 89%
rename from dev-debug/gdb-dashboard/gdb-dashboard-0.17.4.ebuild
rename to dev-debug/gdb-dashboard/gdb-dashboard-0.17.4-r1.ebuild
index b985f1bf1d..a7729bd746 100644
--- a/dev-debug/gdb-dashboard/gdb-dashboard-0.17.4.ebuild
+++ b/dev-debug/gdb-dashboard/gdb-dashboard-0.17.4-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2023-2025 Gentoo Authors
+# Copyright 2023-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{11..12} )
+PYTHON_COMPAT=( python3_{11..13} )
 
 inherit python-single-r1 optfeature wrapper
 
@@ -27,6 +27,8 @@ RDEPEND="
 "
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
+PATCHES=( "${FILESDIR}"/${PN}-0.17.4-fix-buffer-overflow.patch )
+
 pkg_setup() {
        python-single-r1_pkg_setup
 }

Reply via email to