Subject: pkg/31223: php-mbstring's may misinterpretation problem
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <taca@back-street.net>
List: pkgsrc-bugs
Date: 09/08/2005 15:42:00
>Number:         31223
>Category:       pkg
>Synopsis:       php-mbstring's may misinterpretation problem
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 08 15:42:00 +0000 2005
>Originator:     Takahiro Kambe
>Release:        NetBSD 3.99.8
>Organization:
Takahiro Kambe
>Environment:
	
	
System: NetBSD reef.back-street.net 3.99.8 NetBSD 3.99.8 (CF-R3E) #1: Mon Aug 22 22:27:15 JST 2005 taca@reef.back-street.net:/data/i386/obj/sys/arch/i386/compile/CF-R3E i386
Architecture: i386
Machine: i386
>Description:
	php-mbstring's mb_encode_mimeheader() has critial problem which
	misinterpret Japanese string as US-ASCII string in some case.
>How-To-Repeat:
	Use ja-squirrelmail and use Japanese in subject.
>Fix:
	Please add this patch.


$NetBSD$

--- libmbfl/mbfl/mbfilter.c.orig	2005-04-22 14:03:38.000000000 +0900
+++ libmbfl/mbfl/mbfilter.c
@@ -1990,7 +1990,7 @@ mime_header_encoder_collector(int c, voi
 		break;
 
 	default:	/* ASCII */
-		if (!qp_table[(c & 0xff)]) { /* ordinary characters */
+		if (c >= 0 && c < 0x100 && !qp_table[(c & 0xff)]) { /* ordinary characters */
 			mbfl_memory_device_output(c, &pe->tmpdev);
 			pe->status1 = 1;
 		} else if (pe->status1 == 0 && c == 0x20) {	/* repeat SPACE */

>Unformatted: