From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 24 12:30:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A1B32D5 for ; Fri, 24 Jan 2014 12:30:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6642A1744 for ; Fri, 24 Jan 2014 12:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s0OCU1Vn054056 for ; Fri, 24 Jan 2014 12:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s0OCU1Cf054055; Fri, 24 Jan 2014 12:30:01 GMT (envelope-from gnats) Date: Fri, 24 Jan 2014 12:30:01 GMT Message-Id: <201401241230.s0OCU1Cf054055@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Manuel Mausz Subject: Re: kern/185964: Codeset conversion to Chinese Simplified (HZ) is broken / segfaults X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Manuel Mausz List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2014 12:30:01 -0000 The following reply was made to PR kern/185964; it has been noted by GNATS. From: Manuel Mausz To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/185964: Codeset conversion to Chinese Simplified (HZ) is broken / segfaults Date: Fri, 24 Jan 2014 13:22:14 +0100 This is a multi-part message in MIME format. --------------090705060309070305030204 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Attached are patches against head to fix the reported problem + another one I discovered during testing: iconv-void-ptr-ptr.patch ...fixes the reported segfault, however HZ conversion still doesn't work. iconv-HZ-start-comes-before-end.patch ...makes HZ conversion work. Verified using libiconv HZ test file. iconv-VIQR-boundary-check.patch ...fixes a missing boundary check crash in VIQR codeset conversion module I've discovered. cheers, manuel --------------090705060309070305030204 Content-Type: text/x-diff; name="iconv-HZ-start-comes-before-end.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iconv-HZ-start-comes-before-end.patch" Index: lib/libiconv_modules/HZ/citrus_hz.c =================================================================== --- lib/libiconv_modules/HZ/citrus_hz.c (revision 261094) +++ lib/libiconv_modules/HZ/citrus_hz.c (working copy) @@ -65,8 +65,8 @@ } charset_t; typedef struct { + int start; int end; - int start; int width; } range_t; --------------090705060309070305030204 Content-Type: text/x-diff; name="iconv-VIQR-boundary-check.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iconv-VIQR-boundary-check.patch" Index: lib/libiconv_modules/VIQR/citrus_viqr.c =================================================================== --- lib/libiconv_modules/VIQR/citrus_viqr.c (revision 261094) +++ lib/libiconv_modules/VIQR/citrus_viqr.c (working copy) @@ -457,7 +457,7 @@ return (errnum); } } - for (i = 0;; ++i) { + for (i = 0; i < mnemonic_ext_size; ++i) { p = &mnemonic_ext[i]; n = strlen(p->name); if (ei->mb_cur_max < n) --------------090705060309070305030204 Content-Type: text/x-diff; name="iconv-void-ptr-ptr.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iconv-void-ptr-ptr.patch" Index: lib/libc/iconv/citrus_prop.c =================================================================== --- lib/libc/iconv/citrus_prop.c (revision 261094) +++ lib/libc/iconv/citrus_prop.c (working copy) @@ -436,7 +436,7 @@ break; _memstream_ungetc(&ms, ch); errnum = _citrus_prop_parse_element( - &ms, hints, (void ** __restrict)context); + &ms, hints, (void ** __restrict)&context); if (errnum != 0) return (errnum); } Index: lib/libiconv_modules/BIG5/citrus_big5.c =================================================================== --- lib/libiconv_modules/BIG5/citrus_big5.c (revision 261094) +++ lib/libiconv_modules/BIG5/citrus_big5.c (working copy) @@ -181,7 +181,7 @@ if (start > 0xFF || end > 0xFF) return (EINVAL); - ei = (_BIG5EncodingInfo *)ctx; + ei = (_BIG5EncodingInfo *)*ctx; i = strcmp("row", s) ? 1 : 0; i = 1 << i; for (n = start; n <= end; ++n) @@ -199,7 +199,7 @@ if (start > 0xFFFF || end > 0xFFFF) return (EINVAL); - ei = (_BIG5EncodingInfo *)ctx; + ei = (_BIG5EncodingInfo *)*ctx; exclude = TAILQ_LAST(&ei->excludes, _BIG5ExcludeList); if (exclude != NULL && (wint_t)start <= exclude->end) return (EINVAL); --------------090705060309070305030204--