From owner-svn-src-all@freebsd.org Fri Jul 15 23:03:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54B2B9969B; Fri, 15 Jul 2016 23:03:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED5D182C; Fri, 15 Jul 2016 23:03:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6FN3KZx070505; Fri, 15 Jul 2016 23:03:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6FN3KsI070504; Fri, 15 Jul 2016 23:03:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607152303.u6FN3KsI070504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 15 Jul 2016 23:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302916 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2016 23:03:21 -0000 Author: bapt Date: Fri Jul 15 23:03:20 2016 New Revision: 302916 URL: https://svnweb.freebsd.org/changeset/base/302916 Log: Revert 302324 and properly fix the crash with ISO-8859-5 locales PR: 211135 Reported by: jkim Tested by: jkim MFC after: 2 days Modified: head/lib/libc/locale/collate.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Fri Jul 15 21:30:19 2016 (r302915) +++ head/lib/libc/locale/collate.c Fri Jul 15 23:03:20 2016 (r302916) @@ -310,7 +310,7 @@ _collate_lookup(struct xlocale_collate * if ((sptr = *state) != NULL) { *pri = *sptr; sptr++; - if ((sptr == *state) || (*sptr == 0)) + if ((sptr == *state) || (sptr == NULL)) *state = NULL; else *state = sptr; @@ -451,6 +451,7 @@ _collate_wxfrm(struct xlocale_collate *t errno = EINVAL; goto fail; } + state = NULL; pri = COLLATE_MAX_PRIORITY; } if (room) { @@ -469,6 +470,7 @@ _collate_wxfrm(struct xlocale_collate *t errno = EINVAL; goto fail; } + state = NULL; continue; } if (room) { @@ -597,6 +599,7 @@ _collate_sxfrm(struct xlocale_collate *t errno = EINVAL; goto fail; } + state = NULL; pri = COLLATE_MAX_PRIORITY; } @@ -622,6 +625,7 @@ _collate_sxfrm(struct xlocale_collate *t errno = EINVAL; goto fail; } + state = NULL; continue; }