]> granicus.if.org Git - apache/commitdiff
Merge r1617913 from trunk:
authorJoe Orton <jorton@apache.org>
Fri, 9 Mar 2018 09:24:30 +0000 (09:24 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 9 Mar 2018 09:24:30 +0000 (09:24 +0000)
* support/ab.c: Fix crash caused by integer overflow when printing stats with
lot of requests (for example -n 500000000).

Submitted by: jkaluza
Reviewed by: jorton, jim, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1826310 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index 3ae7d27d8f50fb638a70ff7a5855482294f95ebb..9c4c2de02cadc1eb3516af0d1e3a04f6b2b03f4d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -14,8 +14,8 @@ Changes with Apache 2.4.32
   *) mod_ssl: Support SSL DN raw variable extraction without conversion
      to UTF-8, using _RAW suffix on variable names.  [Joe Orton]
 
-  *) ab: Fix send length calculation for the non-blocking connect case
-     introduced in 2.4.30.  [Joe Orton]
+  *) ab: Fix https:// connection failures (regression in 2.4.30); fix
+     crash generating CSV output for large -n.  [Joe Orton, Jan Kaluza]
 
 Changes with Apache 2.4.31
 
index f1020c653a209d8525be07d3974e16a749c8fd8a..3d546afc779327522e96e9e517313084f4145521 100644 (file)
@@ -1106,7 +1106,7 @@ static void output_results(int sig)
                            ap_round_ms(stats[done - 1].time));
                 else
                     printf("  %d%%  %5" APR_TIME_T_FMT "\n", percs[i],
-                           ap_round_ms(stats[(int) (done * percs[i] / 100)].time));
+                           ap_round_ms(stats[(unsigned long)done * percs[i] / 100].time));
             }
         }
         if (csvperc) {
@@ -1123,7 +1123,7 @@ static void output_results(int sig)
                 else if (i == 100)
                     t = ap_double_ms(stats[done - 1].time);
                 else
-                    t = ap_double_ms(stats[(int) (0.5 + done * i / 100.0)].time);
+                    t = ap_double_ms(stats[(unsigned long) (0.5 + (double)done * i / 100.0)].time);
                 fprintf(out, "%d,%.3f\n", i, t);
             }
             fclose(out);