Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2019 14:42:21 +0000 (UTC)
From:      Christoph Moench-Tegeder <cmt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r515868 - in head/sysutils/screen: . files
Message-ID:  <201910281442.x9SEgLiu060721@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cmt
Date: Mon Oct 28 14:42:21 2019
New Revision: 515868
URL: https://svnweb.freebsd.org/changeset/ports/515868

Log:
  sysutils/screen: fix coredump on xterm/rxvt variants without Km
  
  On xterm- and rxvt-variants (and in some other cases) screen's
  InitTermcap() tries to strdup() the terminals "Km" ("key_mouse")
  termcap attribute - but that might be NULL, as some of these
  terminals (notably rxvt and xterm-color) do not have "Km". Trying
  to strdup() NULL results in segfault and coredump.
  Catch that NULL and prevent the segfault.
  
  PR:		241538
  Reported by:	Marcin Cieślak, Gareth de Vaux
  Approved by:	cy@

Modified:
  head/sysutils/screen/Makefile
  head/sysutils/screen/files/patch-termcap.c

Modified: head/sysutils/screen/Makefile
==============================================================================
--- head/sysutils/screen/Makefile	Mon Oct 28 14:36:56 2019	(r515867)
+++ head/sysutils/screen/Makefile	Mon Oct 28 14:42:21 2019	(r515868)
@@ -3,7 +3,7 @@
 
 PORTNAME=	screen
 PORTVERSION=	4.7.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 MASTER_SITES=	GNU \
 		ftp://ftp.gnu.org/gnu/screen/ \

Modified: head/sysutils/screen/files/patch-termcap.c
==============================================================================
--- head/sysutils/screen/files/patch-termcap.c	Mon Oct 28 14:36:56 2019	(r515867)
+++ head/sysutils/screen/files/patch-termcap.c	Mon Oct 28 14:42:21 2019	(r515868)
@@ -1,6 +1,15 @@
---- termcap.c.orig	Wed Jul  5 16:33:30 2000
-+++ termcap.c	Wed Oct 11 05:40:12 2000
-@@ -355,11 +355,7 @@
+--- termcap.c.orig	2019-10-01 22:08:00 UTC
++++ termcap.c
+@@ -227,7 +227,7 @@ int he;
+ 	  (D_CKM && (InStr(D_CKM, "\033[M") || InStr(D_CKM, "\033[<"))))
+         {
+           D_CXT = 1;
+-          kmapdef[0] = SaveStr(D_CKM);
++          kmapdef[0] = D_CKM ? SaveStr(D_CKM) : NULL;
+         }
+       /* "be" seems to be standard for xterms... */
+       if (D_CXT)
+@@ -362,11 +362,7 @@ int he;
    if (D_CG0)
      {
        if (D_CS0 == 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910281442.x9SEgLiu060721>