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 834BB3857028 for ; Thu, 20 Aug 2020 22:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 834BB3857028 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 442463F2D5B8 for ; Thu, 20 Aug 2020 15:14:52 -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 ZtGY9_SisDue; Thu, 20 Aug 2020 15:14:52 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id DE9363F2D54C; Thu, 20 Aug 2020 15:14:50 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 8767D1582201; Thu, 20 Aug 2020 15:14:50 -0700 (PDT) From: Keith Packard To: newlib@sourceware.org Subject: [PATCH 2/6] libc/iconv: Check ces handlers table value in euc_from_ucs_init Date: Thu, 20 Aug 2020 15:14:45 -0700 Message-Id: <20200820221449.686006-3-keithp@keithp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820221449.686006-1-keithp@keithp.com> References: <20200820221449.686006-1-keithp@keithp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 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, 20 Aug 2020 22:14:54 -0000 Need to check the value returned from _iconv_from_ucs_ces_handlers_table.init -- the test was incorrectly comparing the array holding the value. 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 ebd7091b0..56c0c6a6c 100644 --- a/newlib/libc/iconv/ces/euc.c +++ b/newlib/libc/iconv/ces/euc.c @@ -149,7 +149,7 @@ ok: data->data[i] = _iconv_from_ucs_ces_handlers_table.init ( rptr, data->desc[i].csname); - if (data->data == NULL) + if (data->data[i] == NULL) goto error; } -- 2.28.0