From patchwork Wed Oct 23 10:47:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qingqing Li X-Patchwork-Id: 1182039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106214-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="XXOqLUob"; dkim-atps=neutral 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 46ynCP31BHz9sP3 for ; Wed, 23 Oct 2019 21:48:00 +1100 (AEDT) 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 :mime-version:content-transfer-encoding:content-type; q=dns; s= default; b=USVLxgklh0WpAxuDsO2KjYocjVujlwK092Pwchr9OKIukgIl+ddSM Qc1BlMQiJYXYjleBTzP8O17js2IeNlAtn0+rXzwWB4pFPPZrfLzPEPYxeQldh0Ut W/KljYkfedaptJ9M6fo53B3YbVItE4w4sptQaAJyPiPv/COJNZZcso= 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 :mime-version:content-transfer-encoding:content-type; s=default; bh=WWBzqdMZFMeS+vJals1Fyo2zcHI=; b=XXOqLUobmY+ZcrO72GoWBib4cqA8 lx7fZKtOg551yqTqR+9do/Dnx7sySbY2sMWRP8nTGGYzqnEmP5MwxEjHs45SJZ21 xiZx6awC54sujXlPJIiRA4JJQYMrq/UtXXVvXfoaBUQokyRslxU3ecwnFWTgOBAg wjMD+Luquc2x6rY= Received: (qmail 41450 invoked by alias); 23 Oct 2019 10:47:54 -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 41440 invoked by uid 89); 23 Oct 2019 10:47:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: huawei.com From: To: CC: Subject: [PATCH] math: enhance the endloop condition of function handle_input_flag found that the endloop condition is not correct, cause when the loop variable " i " euqal to 16, than the input_flags[16] will be out of bounds. though i think for now the inputs maybe all right, but just enhanced it. Date: Wed, 23 Oct 2019 18:47:37 +0800 Message-ID: <20191023104737.1048-1-liqingqing3@huawei.com> MIME-Version: 1.0 From: l00283554 --- math/gen-auto-libm-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/gen-auto-libm-tests.c b/math/gen-auto-libm-tests.c index f15af29..08684c4 100644 --- a/math/gen-auto-libm-tests.c +++ b/math/gen-auto-libm-tests.c @@ -1298,7 +1298,7 @@ handle_input_flag (char *arg, input_flag *flag, char c = *ep; *ep = 0; bool found = false; - for (input_flag_type i = flag_first_flag; i <= num_input_flag_types; i++) + for (input_flag_type i = flag_first_flag; i < num_input_flag_types; i++) { if (strcmp (arg, input_flags[i]) == 0) {