httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Sun, 13 Jan 2002 06:06:52 GMT
brianp      02/01/12 22:06:52

  Modified:    modules/filters mod_include.c
  Log:
  Allocate only as much data as we need to hold token values in the
  "<!--#if" processing code, rather always allocating an 8KB structure
  
  Revision  Changes    Path
  1.185     +5 -4      httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- mod_include.c	6 Jan 2002 06:53:25 -0000	1.184
  +++ mod_include.c	13 Jan 2002 06:06:52 -0000	1.185
  @@ -1645,12 +1645,9 @@
   };
   struct token {
       enum token_type type;
  -    char value[MAX_STRING_LEN];
  +    char* value;
   };
   
  -/* there is an implicit assumption here that string is at most MAX_STRING_LEN-1
  - * characters long...
  - */
   static const char *get_ptoken(request_rec *r, const char *string, 
                                 struct token *token, int *unmatched)
   {
  @@ -1659,6 +1656,8 @@
       char qs = 0;
       int tkn_fnd = 0;
   
  +    token->value = NULL;
  +
       /* Skip leading white space */
       if (string == (char *) NULL) {
           return (char *) NULL;
  @@ -1735,6 +1734,8 @@
           break;
       }
       /* We should only be here if we are in a string */
  +    token->value = apr_palloc(r->pool, strlen(string) + 2); /* 2 for ch plus
  +                                                               trailing null */
       if (!qs) {
           token->value[next++] = ch;
       }
  
  
  

Mime
View raw message