From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id CC358386F82A for ; Thu, 9 Jul 2020 23:59:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC358386F82A Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id D67153F2CDC6 for ; Thu, 9 Jul 2020 16:59:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cxKltXU2xKas; Thu, 9 Jul 2020 16:59:04 -0700 (PDT) Received: from keithp.com (67-40-10-69.tukw.qwest.net [67.40.10.69]) by elaine.keithp.com (Postfix) with ESMTPSA id 6D3643F2CDC4; Thu, 9 Jul 2020 16:59:04 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 884C115821A6; Thu, 9 Jul 2020 16:58:55 -0700 (PDT) From: Keith Packard To: newlib@sourceware.org Subject: [PATCH 1/4] libc/iconv: Detect CES handler loading failure Date: Thu, 9 Jul 2020 16:58:45 -0700 Message-Id: <20200709235848.3496713-1-keithp@keithp.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 23:59:07 -0000 Fix the code checking for character set loading failure so that it checks the return value from the init function. Signed-off-by: Keith Packard --- newlib/libc/iconv/ces/euc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/iconv/ces/euc.c b/newlib/libc/iconv/ces/euc.c index 29d36f941..ebd7091b0 100644 --- a/newlib/libc/iconv/ces/euc.c +++ b/newlib/libc/iconv/ces/euc.c @@ -306,7 +306,7 @@ ok: data->data[i] = _iconv_to_ucs_ces_handlers_table.init ( rptr, data->desc[i].csname); - if (data->data == NULL) + if (data->data[i] == NULL) goto error; } -- 2.27.0