From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jun 3 04:40:25 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89C9C16A4CE for ; Thu, 3 Jun 2004 04:40:25 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 730E443D54 for ; Thu, 3 Jun 2004 04:40:25 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i53BePj1082047 for ; Thu, 3 Jun 2004 04:40:25 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i53BePkE082046; Thu, 3 Jun 2004 04:40:25 -0700 (PDT) (envelope-from gnats) Resent-Date: Thu, 3 Jun 2004 04:40:25 -0700 (PDT) Resent-Message-Id: <200406031140.i53BePkE082046@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oleg Sharoiko Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BD2316A4CE; Thu, 3 Jun 2004 04:32:24 -0700 (PDT) Received: from brain.cc.rsu.ru (brain.cc.rsu.ru [195.208.252.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E56F43D41; Thu, 3 Jun 2004 04:32:23 -0700 (PDT) (envelope-from os@brain.cc.rsu.ru) Received: from brain.cc.rsu.ru (localhost [127.0.0.1]) by brain.cc.rsu.ru (8.12.11/8.12.9) with ESMTP id i53BW9f2051764; Thu, 3 Jun 2004 15:32:09 +0400 (MSD) (envelope-from os@brain.cc.rsu.ru) Received: (from os@localhost) by brain.cc.rsu.ru (8.12.11/8.12.9/Submit) id i53BW8S2051763; Thu, 3 Jun 2004 15:32:08 +0400 (MSD) (envelope-from os) Message-Id: <200406031132.i53BW8S2051763@brain.cc.rsu.ru> Date: Thu, 3 Jun 2004 15:32:08 +0400 (MSD) From: Oleg Sharoiko To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: DougB@FreeBSD.org cc: and@rsu.ru Subject: ports/67522: [PATCH] mail/pine4 has broken charset conversion in 4.60 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2004 11:40:25 -0000 >Number: 67522 >Category: ports >Synopsis: [PATCH] mail/pine4 has broken charset conversion in 4.60 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 03 04:40:24 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Oleg Sharoiko >Release: FreeBSD 5.2-CURRENT i386 >Organization: Computer Center of Rostov State University >Environment: System: FreeBSD brain.cc.rsu.ru 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Tue May 18 18:15:48 MSD 2004 os@brain.cc.rsu.ru:/usr/obj/usr/src/sys/brain.athlon-xp.HEAD.2004-01-30 i386 >Description: Version 4.60 of Pine has a bug in conversion_table(): unsigned short value is being assigned to unsigned char variable which is later compared to another unsigned short value. It's clear that such a comparison is almost always false as these unsigned short values are unicode chars from national alphabets which do not fit in unsigned char. There is also another bug: after the correct character in destination charset is found it's rather being replaced with the code of character in original charset. Thus the application of table created by conversion_tables always leaves text untouched. Those guys from UW shouldn't really left such a bugs in the code :( >How-To-Repeat: Install pine 4.60 Set your console to f.e. KOI8-R Open mailbox with a letter in windows-1251 and see it's not recoded pine 4.58 had no such a problem >Fix: Apply the patch: --- pine4/files/patch-pine::strings.c Thu Jan 1 03:00:00 1970 +++ pine4/files/patch-pine::strings.c Thu Jun 3 15:09:37 2004 @@ -0,0 +1,19 @@ +--- pine/strings.c Thu Jun 3 14:59:58 2004 ++++ pine/strings.c Thu Jun 3 15:00:41 2004 +@@ -3754,7 +3754,7 @@ + p = ct->table = (unsigned char *) + fs_get(256 * sizeof(unsigned char)); + for(i = 0; i < 256; i++){ +- unsigned char fc; ++ unsigned short fc; + p[i] = '?'; + switch(from->type){ /* get "from" UCS-2 codepoint */ + case CT_1BYTE0: /* ISO 8859-1 */ +@@ -3789,7 +3789,6 @@ + } + break; + } +- p[i] = i; + } + break; + } >Release-Note: >Audit-Trail: >Unformatted: