httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/support ab.c
Date Sat, 28 Aug 2004 16:20:09 GMT
nd          2004/08/28 09:20:09

  Modified:    .        Tag: APACHE_2_0_BRANCH STATUS
               support  Tag: APACHE_2_0_BRANCH ab.c
  Log:
  Fix crash, when out of memory.
  
  Submitted by: Reasoning report ID 29
  Reviewed by: Erik Abele, Ian Holsman
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.751.2.1034 +1 -20     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.1033
  retrieving revision 1.751.2.1034
  diff -u -u -r1.751.2.1033 -r1.751.2.1034
  --- STATUS	28 Aug 2004 16:11:42 -0000	1.751.2.1033
  +++ STATUS	28 Aug 2004 16:20:08 -0000	1.751.2.1034
  @@ -262,25 +262,6 @@
                    shows breakage on Solaris which can't -lcrypto -lssl without
                    the extra pkgconfig/openssl.pc Libs: * foo }
   
  -    * ab: catch out of memory (reasoning report ID 29)
  -        support/ab.c: r1.125
  -      +1: nd, erikabele, ianh
  -       0: trawick, who is not about to stand in anybody's way on this,
  -          but has two comments nonetheless:
  -          a) with no abort function specified for the pools, this is just
  -             one of many possible failures
  -          b) my guess is that a heap shortage encountered by ab is
  -             much more likely to be caused by an ab bug instead of by a
  -             user setup error (ulimit) or system resource shortage...
  -             is an error message better than a coredump in that case?
  -
  -          nd: hmm. This one is a pure (and obvious) malloc. Once we may
  -              decide to use a pool-abort_fn; then the situation turns
  -              around... :)
  -              Yes, I think, a useful error message is better than
  -              a coredump in this case.
  -          jerenkrantz: Oh, bah.  Let 'em segfault.  Use flood!
  -
       * mod_ssl: fix a link failure when the openssl-engine libraries are
         present but the engine headers are missing.
           modules/ssl/mod_ssl.c: r1.87
  
  
  
  No                   revision
  No                   revision
  1.121.2.12 +7 -3      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.11
  retrieving revision 1.121.2.12
  diff -u -u -r1.121.2.11 -r1.121.2.12
  --- ab.c	12 Aug 2004 15:19:23 -0000	1.121.2.11
  +++ ab.c	28 Aug 2004 16:20:08 -0000	1.121.2.12
  @@ -1599,7 +1599,11 @@
        * Combine headers and (optional) post file into one contineous buffer
        */
       if (posting == 1) {
  -	char *buff = (char *) malloc(postlen + reqlen + 1);
  +	char *buff = malloc(postlen + reqlen + 1);
  +        if (!buff) {
  +            fprintf(stderr, "error creating request buffer: out of memory\n");
  +            return;
  +        }
   	strcpy(buff, request);
   	strcpy(buff + reqlen, postdata);
   	request = buff;
  
  
  

Mime
View raw message