From owner-svn-src-stable@freebsd.org Fri Jun 3 07:35:00 2016 Return-Path: Delivered-To: svn-src-stable@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 EE5E4B68F73; Fri, 3 Jun 2016 07:35:00 +0000 (UTC) (envelope-from ache@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 BB8401D3E; Fri, 3 Jun 2016 07:35:00 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u537Yxrp094721; Fri, 3 Jun 2016 07:34:59 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u537Yx4o094719; Fri, 3 Jun 2016 07:34:59 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201606030734.u537Yx4o094719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Fri, 3 Jun 2016 07:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301245 - stable/10/lib/libc/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2016 07:35:01 -0000 Author: ache Date: Fri Jun 3 07:34:59 2016 New Revision: 301245 URL: https://svnweb.freebsd.org/changeset/base/301245 Log: For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point to the character after the one this conversion stopped at. PR: 209907 Submitted by: Roel Standaert (partially) Modified: stable/10/lib/libc/locale/ascii.c stable/10/lib/libc/locale/none.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/ascii.c ============================================================================== --- stable/10/lib/libc/locale/ascii.c Fri Jun 3 07:24:41 2016 (r301244) +++ stable/10/lib/libc/locale/ascii.c Fri Jun 3 07:34:59 2016 (r301245) @@ -143,6 +143,7 @@ _ascii_mbsnrtowcs(wchar_t * __restrict d nchr = 0; while (len-- > 0 && nms-- > 0) { if (*s & 0x80) { + *src = s; errno = EILSEQ; return ((size_t)-1); } @@ -177,6 +178,7 @@ _ascii_wcsnrtombs(char * __restrict dst, nchr = 0; while (len-- > 0 && nwc-- > 0) { if (*s < 0 || *s > 127) { + *src = s; errno = EILSEQ; return ((size_t)-1); } Modified: stable/10/lib/libc/locale/none.c ============================================================================== --- stable/10/lib/libc/locale/none.c Fri Jun 3 07:24:41 2016 (r301244) +++ stable/10/lib/libc/locale/none.c Fri Jun 3 07:34:59 2016 (r301245) @@ -172,6 +172,7 @@ _none_wcsnrtombs(char * __restrict dst, nchr = 0; while (len-- > 0 && nwc-- > 0) { if (*s < 0 || *s > UCHAR_MAX) { + *src = s; errno = EILSEQ; return ((size_t)-1); }