Show
Ignore:
Timestamp:
06/19/08 18:01:36 (6 months ago)
Author:
bart
Message:

Initialise pointers before using them
Fix buffer overflow

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/eaccelerator.c

    r344 r347  
    330330    len = strlen(str); 
    331331    memcpy(buf, str, (len > 255) ? 255 : len); 
    332     buf[255] = '\0'; 
     332    buf[254] = '\0'; 
    333333 
    334334    memset(s, 0, 255); 
     
    14401440static struct ea_pattern_t *ea_parse_filter(char *filter) 
    14411441{ 
    1442         char *saveptr, *token
    1443         struct ea_pattern_t *list_head, *p
     1442        char *saveptr = NULL, *token = NULL
     1443        struct ea_pattern_t *list_head = NULL, *p = NULL
    14441444        size_t len; 
    14451445 
    14461446        // tokenize the filter string on a space 
    1447         list_head = NULL; 
    1448         p = NULL; 
    14491447        while ((token = php_strtok_r(filter, " ", &saveptr)) != NULL) { 
    14501448                filter = NULL;