aboutsummaryrefslogtreecommitdiff
path: root/sysutils/screen
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2015-09-08 16:35:20 +0000
committerMark Felder <feld@FreeBSD.org>2015-09-08 16:35:20 +0000
commita3aa75afeb2b636e42617950bd60726c243212ff (patch)
treea39fd8ddefad2c8ee09f443ae6e7b29d59015cc5 /sysutils/screen
parent3a6b5a016687f9245b41f35f047d49adce8b6095 (diff)
downloadports-a3aa75afeb2b636e42617950bd60726c243212ff.tar.gz
ports-a3aa75afeb2b636e42617950bd60726c243212ff.zip
Add patch to resolve stack overflow vulnerability
MFH: 2015Q3 Security: 98092444-5645-11e5-9ad8-14dae9d210b8 Security: CVE-2015-6806
Notes
Notes: svn path=/head/; revision=396408
Diffstat (limited to 'sysutils/screen')
-rw-r--r--sysutils/screen/Makefile2
-rw-r--r--sysutils/screen/files/patch-CVE-2015-680655
2 files changed, 56 insertions, 1 deletions
diff --git a/sysutils/screen/Makefile b/sysutils/screen/Makefile
index ee03f302e07d..c6f6588a8c22 100644
--- a/sysutils/screen/Makefile
+++ b/sysutils/screen/Makefile
@@ -3,7 +3,7 @@
PORTNAME= screen
PORTVERSION= 4.3.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= http://ftp.gnu.org/gnu/screen/ \
ftp://ftp.gnu.org/gnu/screen/ \
diff --git a/sysutils/screen/files/patch-CVE-2015-6806 b/sysutils/screen/files/patch-CVE-2015-6806
new file mode 100644
index 000000000000..fac3aa79325c
--- /dev/null
+++ b/sysutils/screen/files/patch-CVE-2015-6806
@@ -0,0 +1,55 @@
+From b7484c224738247b510ed0d268cd577076958f1b Mon Sep 17 00:00:00 2001
+From: Kuang-che Wu <kcwu@csie.org>
+Date: Mon, 31 Aug 2015 17:49:57 +0000
+Subject: Fix stack overflow due to too deep recursion
+
+Bug: 45713
+
+How to reproduce:
+Run this command inside screen
+$ printf '\x1b[10000000T'
+
+screen will recursively call MScrollV to depth n/256. This is time consuming and will overflow stack if n is huge.
+---
+diff --git a/src/ansi.c b/src/ansi.c
+index a342fb1..152d2ef 100644
+--- ansi.c
++++ ansi.c
+@@ -2502,13 +2502,13 @@ int n, ys, ye, bce;
+ return;
+ if (n > 0)
+ {
++ if (ye - ys + 1 < n)
++ n = ye - ys + 1;
+ if (n > 256)
+ {
+ MScrollV(p, n - 256, ys, ye, bce);
+ n = 256;
+ }
+- if (ye - ys + 1 < n)
+- n = ye - ys + 1;
+ #ifdef COPY_PASTE
+ if (compacthist)
+ {
+@@ -2562,14 +2562,14 @@ int n, ys, ye, bce;
+ }
+ else
+ {
+- if (n < -256)
+- {
+- MScrollV(p, n + 256, ys, ye, bce);
+- n = -256;
+- }
+ n = -n;
+ if (ye - ys + 1 < n)
+ n = ye - ys + 1;
++ if (n > 256)
++ {
++ MScrollV(p, - (n - 256), ys, ye, bce);
++ n = 256;
++ }
+
+ ml = p->w_mlines + ye;
+ /* Clear lines */
+--
+cgit v0.9.0.2