ports/131857: [patch] devel/libslang2 line drawing characters bug

Szalai Andras szalai.bandi at gmail.com
Wed Feb 18 21:50:02 UTC 2009


>Number:         131857
>Category:       ports
>Synopsis:       [patch] devel/libslang2 line drawing characters bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 18 21:50:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Szalai Andras
>Release:        FreeBSD 7.1-RELEASE-p1 i386
>Organization:
none
>Environment:
System: FreeBSD tristania.kispest.home 7.1-RELEASE-p1 FreeBSD 7.1-RELEASE-p1 #0: Sun Jan 11 17:34:03 CET 2009 root at tristania.kispest.home:/disk/ad8p5/root.usr/src/sys/i386/compile/TRISTANIA i386

Relevant package versions:

mc-4.6.2
libslang2-2.1.4

>Description:

If you execute an application (e.g. mc), which uses devel/libslang2 to
do screen I/O on a non-unicode terminal then the line drawing characters
will appear as spaces.

>How-To-Repeat:

$ export LANG=en_US.ISO8859-1
$ mc

>Fix:

I have tracked the problem down to a bug in the slang2 library. In the file
src/sldisply.c there is a function named tt_tgetstr which reads out capability
strings from termcap.

This function calls ncurses' tgetstr which does the real work, however the
buffer for the capability string is a local variable (which will be filled by
tgetstr). But in case of the "ac" capability, tt_tgetstr returns with the
address of this buffer, and therefore it will point to an invalid address.

The attached patch solves this isssue.

--- src.diff begins here ---
diff -ru orig/src/sldisply.c new/src/sldisply.c
--- orig/src/sldisply.c	2008-08-25 02:20:40.000000000 +0200
+++ new/src/sldisply.c	2009-02-15 16:58:30.000000000 +0100
@@ -2229,14 +2229,6 @@
    s = _pSLtt_tigetstr (Terminfo, cap);
 #endif
 
-   /* Do not strip pad info for alternate character set.  I need to make
-    * this more general.
-    */
-   /* FIXME: Priority=low; */
-   if (0 == strcmp (cap, "ac"))
-     return s;
-
-   s = fixup_tgetstr (s);
 #ifdef USE_TERMCAP
    if ((s >= area_buf) && (s < area_buf + sizeof(area_buf)))
      {
@@ -2249,6 +2241,15 @@
 	s = SLmake_string (s);
      }
 #endif
+
+   /* Do not strip pad info for alternate character set.  I need to make
+    * this more general.
+    */
+   /* FIXME: Priority=low; */
+   if (0 == strcmp (cap, "ac"))
+     return s;
+
+   s = fixup_tgetstr (s);
    return s;
 }
 
--- src.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list