summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorliqingqing <liqingqing3@huawei.com>2019-11-07 00:26:54 +0000
committerJoseph Myers <joseph@codesourcery.com>2019-11-07 00:26:54 +0000
commitdae7bf38978294f7d1aeece7f31c738281a3ba04 (patch)
treeb60efe75e5473fb8992199f8ed70a90d57151af4 /math
parent807edded258e888dbfa0d19ca967d6e42882d069 (diff)
downloadglibc-dae7bf38978294f7d1aeece7f31c738281a3ba04.tar.gz
glibc-dae7bf38978294f7d1aeece7f31c738281a3ba04.tar.xz
glibc-dae7bf38978294f7d1aeece7f31c738281a3ba04.zip
math: enhance the endloop condition of function handle_input_flag
In the function handle_input_flag, the end-loop condition is not
correct, because when the loop variable i equals 16
(num_input_flag_types), then input_flags[16] will be out of bounds.
(This issue is only relevant with invalid input files to
gen-auto-libm-tests.)
Diffstat (limited to 'math')
-rw-r--r--math/gen-auto-libm-tests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/math/gen-auto-libm-tests.c b/math/gen-auto-libm-tests.c
index f15af29a4e..08684c4646 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)
 	{