pat->content.Set.ptr_s = 0;
pat->content.Set.elements = NULL;
- ++glob->size;
+ if(++glob->size > (GLOB_PATTERN_NUM*2)) {
+ snprintf(glob->errormsg, sizeof(glob->errormsg), "too many globs used\n");
+ return GLOB_ERROR;
+ }
while(!done) {
switch (*pattern) {
pat = &glob->pattern[glob->size / 2];
/* patterns 0,1,2,... correspond to size=1,3,5,... */
- ++glob->size;
+ if(++glob->size > (GLOB_PATTERN_NUM*2)) {
+ snprintf(glob->errormsg, sizeof(glob->errormsg), "too many globs used\n");
+ return GLOB_ERROR;
+ }
if(ISALPHA(*pattern)) {
/* character range detected */
} content;
} URLPattern;
+/* the total number of globs supported */
+#define GLOB_PATTERN_NUM 9
+
typedef struct {
char *literal[10];
- URLPattern pattern[9];
+ URLPattern pattern[GLOB_PATTERN_NUM+1];
size_t size;
size_t urllen;
char *glob_buffer;