From patchwork Tue Feb 23 09:21:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 586768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 50089140B95 for ; Tue, 23 Feb 2016 20:22:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=tS5WBuXM; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=qFrpt4Fk+tA685x/e/9YG18zy4BPHVr it3LNeM7fUlHqjCS+bjocLRK1PBGizeM1id63g1++ER1c8JhTB7POITO1pJgwAOg hsPN5cfs01oXr66+uJUV8uKQy6sNaJszqcGyQF/AVt58Db9pXUw+NDei2ng7zPNE aCvwZGQuRJMc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=OnRWjs7G/IN7AHlnyIXqkx+TdrQ=; b=tS5WB uXMQt4Iv3afPIZ4iU+jrlYfI12gjW0Ti8xGca3v/0jGYduUlplgY7mVInMLQ4re8 4rny0W8VoL6lnIsOwGR++R6NfQu6vcgX9hfSy5qE4ACmDjSdjeGx8YtleozY8Ze8 98NPyIrdSpApQdYb0BoHSNfpcRrgDFmA+u/xk8= Received: (qmail 121727 invoked by alias); 23 Feb 2016 09:21:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 121644 invoked by uid 89); 23 Feb 2016 09:21:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=iconv X-HELO: e06smtp14.uk.ibm.com X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: stli@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH 13/14] Fix ucs4le_internal_loop in error case. Date: Tue, 23 Feb 2016 10:21:17 +0100 Message-Id: <1456219278-5258-14-git-send-email-stli@linux.vnet.ibm.com> In-Reply-To: <1456219278-5258-1-git-send-email-stli@linux.vnet.ibm.com> References: <1456219278-5258-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022309-0017-0000-0000-00000746F487 When converting from UCS4LE to INTERNAL, the input-value is checked for a too large value and the iconv() call sets errno to EILSEQ. In this case the inbuf argument of the iconv() call should point to the invalid character, but it points to the beginning of the inbuf. Thus this patch updates the pointers inptrp and outptrp before returning in this error case. ChangeLog: * iconv/gconv_simple.c (ucs4le_internal_loop): Update inptrp and outptrp in case of an illegal input. --- iconv/gconv_simple.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index 5412bd6..f66bf34 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -638,6 +638,8 @@ ucs4le_internal_loop (struct __gconv_step *step, continue; } + *inptrp = inptr; + *outptrp = outptr; return __GCONV_ILLEGAL_INPUT; }