* [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.
@ 2019-10-23 10:47 liqingqing3
2019-10-23 11:06 ` Florian Weimer
0 siblings, 1 reply; 2+ messages in thread
From: liqingqing3 @ 2019-10-23 10:47 UTC (permalink / raw)
To: libc-alpha; +Cc: hushiyuan
From: l00283554 <liqingqing3@huawei.com>
---
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)
{
--
2.6.4.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [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.
2019-10-23 10:47 [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 liqingqing3
@ 2019-10-23 11:06 ` Florian Weimer
0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2019-10-23 11:06 UTC (permalink / raw)
To: liqingqing3; +Cc: libc-alpha, hushiyuan
> From: l00283554 <liqingqing3@huawei.com>
>
> ---
> 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)
> {
I think the change looks good. Would you please resubmit it with a
properly formatted commit message? Thanks.
Florian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-23 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 10:47 [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 liqingqing3
2019-10-23 11:06 ` Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).