summaryrefslogtreecommitdiff
path: root/app-misc/mc/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-02-13 21:41:11 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-02-13 21:41:11 +0000
commitc8d60dada2ec8eb48b2d2b290cd6683ccec40e39 (patch)
treec44943ee0563a3fa957716de909fed683117fcb9 /app-misc/mc/files
parent69051588e2f955485fe5d45d45e616bc60a2de57 (diff)
gentoo (valentine's day) resync : 14.02.2021
Diffstat (limited to 'app-misc/mc/files')
-rw-r--r--app-misc/mc/files/mc-4.8.26-shadow-crash.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/app-misc/mc/files/mc-4.8.26-shadow-crash.patch b/app-misc/mc/files/mc-4.8.26-shadow-crash.patch
new file mode 100644
index 000000000000..4eeee45bc8e6
--- /dev/null
+++ b/app-misc/mc/files/mc-4.8.26-shadow-crash.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/768285
+https://midnight-commander.org/ticket/4192
+
+From 6394547dbffbad44ea50c64c282de4b610ca07bf Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 3 Feb 2021 09:47:13 +0300
+Subject: [PATCH] Ticket #4192: fix crash if shadow is out of screen.
+
+(tty_clip): add extra tests for area boundaries.
+
+Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
+---
+ lib/tty/tty-ncurses.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
+index 03235cd5b..5cddf5059 100644
+--- a/lib/tty/tty-ncurses.c
++++ b/lib/tty/tty-ncurses.c
+@@ -152,9 +152,16 @@ tty_clip (int *y, int *x, int *rows, int *cols)
+
+ if (*y + *rows > LINES)
+ *rows = LINES - *y;
++
++ if (*rows <= 0)
++ return FALSE;
++
+ if (*x + *cols > COLS)
+ *cols = COLS - *x;
+
++ if (*cols <= 0)
++ return FALSE;
++
+ return TRUE;
+ }
+
+--
+2.30.0
+