ports/84938: x11/rxvt-unicode incorrectly handles incomplete valid multibyte character sequences

Li-Lun Wang (Leland Wang) llwang at infor.org
Mon Aug 15 06:10:07 UTC 2005


>Number:         84938
>Category:       ports
>Synopsis:       x11/rxvt-unicode incorrectly handles incomplete valid multibyte character sequences
>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:   Mon Aug 15 06:10:06 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Li-Lun Wang (Leland Wang)
>Release:        FreeBSD 6.0-BETA2 i386
>Organization:
>Environment:
System: FreeBSD ll-X31 6.0-BETA2 FreeBSD 6.0-BETA2 #4: Thu Aug  4 15:56:03 CDT 2005 root at ll-X31:/usr/obj/usr/src/sys/X31  i386


	
>Description:
When a multibyte character sequence is valid but incomplete (mbrtowc()
returns (size_t)-2), urxvt should set cmdbuf_ptr = cmdbuf_endp.
There is a patch in the port making this happen only when
__FreeBSD_version>502110.
However, __FreeBSD_version is not defined without the inclusion of
sys/param.h, making the next call to next_char() incorrectly feed the
same string into mbrtowc(), thus returning a (size_t)-1.

	
>How-To-Repeat:
Install x11/rxvt-unicode on a box of which __FreeBSD_version > 502110.
Open urxvt, connect to a somewhat slow host, and read some documents
with characters in CJK in UTF-8. Once in a while, some character will
be incorrectly interpreted.
	
>Fix:
diff -urN rxvt-unicode.orig/files/patch-src::command.C rxvt-unicode/files/patch-src::command.C
--- rxvt-unicode.orig/files/patch-src::command.C	Wed Dec 29 15:29:21 2004
+++ rxvt-unicode/files/patch-src::command.C	Mon Aug 15 00:41:28 2005
@@ -1,6 +1,14 @@
---- src/command.C.orig	Wed Dec 29 20:09:31 2004
-+++ src/command.C	Wed Dec 29 22:07:49 2004
-@@ -2716,7 +2716,9 @@
+--- src/command.C.orig	Tue Jul 12 22:11:42 2005
++++ src/command.C	Mon Aug 15 00:40:13 2005
+@@ -55,6 +55,7 @@
+ #endif
+ 
+ #include <csignal>
++#include <sys/param.h>
+ 
+ /*----------------------------------------------------------------------*/
+ 
+@@ -2716,7 +2717,9 @@
        if (len == (size_t)-2)
          {
            // the mbstate stores incomplete sequences. didn't know this :/

	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list