httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject cvs commit: httpd-2.0/support ab.c
Date Sat, 27 Mar 2004 00:08:41 GMT
madhum      2004/03/26 16:08:41

  Modified:    .        Tag: APACHE_2_0_BRANCH STATUS
               support  Tag: APACHE_2_0_BRANCH ab.c
  Log:
  Limit the concurrency to MAX_CONCURRENCY.
  Otherwise, ab may dump core (calloc fails) when a arbitrarily huge value
  is used.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.751.2.773 +1 -6      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.772
  retrieving revision 1.751.2.773
  diff -u -r1.751.2.772 -r1.751.2.773
  --- STATUS	25 Mar 2004 02:40:17 -0000	1.751.2.772
  +++ STATUS	27 Mar 2004 00:08:40 -0000	1.751.2.773
  @@ -88,11 +88,6 @@
              modules/dav/fs/lock.c: r1.31
          +1: trawick
   
  -    *) Limit the concurrency in 'ab' to MAX_CONCURRENCY to prevent a 
  -       segmentation fault.
  -           support/ab.c: r1.140, r1.141
  -       +1: madhum, trawick, jjclar
  -
       *) Fix the comment delimiter so that it correctly parses the username
           comment.  Also add a terminate function to allow NetWare to pause
   	the output before the screen is destroyed.
  
  
  
  No                   revision
  No                   revision
  1.121.2.10 +8 -2      httpd-2.0/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/ab.c,v
  retrieving revision 1.121.2.9
  retrieving revision 1.121.2.10
  diff -u -r1.121.2.9 -r1.121.2.10
  --- ab.c	17 Mar 2004 02:05:26 -0000	1.121.2.9
  +++ ab.c	27 Mar 2004 00:08:41 -0000	1.121.2.10
  @@ -233,6 +233,7 @@
   
   #define ap_min(a,b) ((a)<(b))?(a):(b)
   #define ap_max(a,b) ((a)>(b))?(a):(b)
  +#define MAX_CONCURRENCY 20000
   
   /* --------------------- GLOBALS ---------------------------- */
   
  @@ -2139,6 +2140,11 @@
   	usage(argv[0]);
       }
   
  +    if ((concurrency < 0) || (concurrency > MAX_CONCURRENCY)) {
  +       fprintf(stderr, "%s: Invalid Concurrency [Range 0..%d]\n",
  +                argv[0], MAX_CONCURRENCY);
  +        usage(argv[0]);
  +    }
   
       if ((heartbeatres) && (requests > 150)) {
   	heartbeatres = requests / 10;	/* Print line every 10% of requests */
  
  
  

Mime
View raw message