From owner-freebsd-bugs Sat Apr 13 1:40:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id ECC8F37B416 for ; Sat, 13 Apr 2002 01:40:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3D8e2O19513; Sat, 13 Apr 2002 01:40:02 -0700 (PDT) (envelope-from gnats) Received: from ritax.dorm.ccu.edu.tw (ritax.dorm.ccu.edu.tw [140.123.11.79]) by hub.freebsd.org (Postfix) with SMTP id 527C537B405 for ; Sat, 13 Apr 2002 01:36:02 -0700 (PDT) Received: (qmail 90044 invoked by uid 1001); 13 Apr 2002 08:35:12 -0000 Message-Id: <20020413083512.90043.qmail@ritax.dorm.ccu.edu.tw> Date: 13 Apr 2002 08:35:12 -0000 From: Yong-Jhen Hong Reply-To: Yong-Jhen Hong To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/37034: Fixed maximum character length in EUC Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 37034 >Category: misc >Synopsis: Fixed maximum character length in EUC >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 13 01:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Yong-Jhen Hong >Release: FreeBSD 4.5-STABLE i386 >Organization: N/A >Environment: System: FreeBSD ritax.dorm.ccu.edu.tw 4.5-STABLE FreeBSD 4.5-STABLE #0: Tue Mar 19 03:06:46 CST 2002 toor@ritax.dorm.ccu.edu.tw:/usr/obj/usr/src/sys/RITAX i386 >Description: The EUC rune-related functions use a fixed maximum character length, which forbids longer multibyte characters. >How-To-Repeat: Create a EUC encoding LC_CTYPE locale file which has codeset(s) longer than three bytes, use mbtowc(3) to convert such multibyte words. >Fix: Apply the following patch: --- patch-euc begins here --- --- euc.c Mon Jun 5 05:47:39 2000 +++ euc.c.new Thu Mar 28 15:19:02 2002 @@ -82,6 +82,7 @@ free(rl); return (ENOMEM); } + __mb_cur_max = 0; for (x = 0; x < 4; ++x) { ei->count[x] = (int) strtol(v, &e, 0); if (v == e || !(v = e)) { @@ -89,6 +90,8 @@ free(ei); return (EFTYPE); } + if (__mb_cur_max < ei->count[x]) + __mb_cur_max = ei->count[x]; while (*v == ' ' || *v == '\t') ++v; ei->bits[x] = (int) strtol(v, &e, 0); @@ -114,7 +117,6 @@ } rl->variable_len = sizeof(_EucInfo); _CurrentRuneLocale = rl; - __mb_cur_max = 3; return (0); } --- patch-euc ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message