if (ctx->head_start_index > 0) {
ctx->head_start_index = 0;
ctx->head_start_bucket = tmp_bkt;
+ ctx->parse_pos = 0;
+ ctx->state = PRE_HEAD;
}
return tmp_bkt;
}
while (c < buf + len) {
if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
- /* gonna start over parsing the directive next time through */
- ctx->directive_length = 0;
+ if (ctx->state == PARSE_DIRECTIVE) {
+ /* gonna start over parsing the directive next time through */
+ ctx->directive_length = 0;
+ ctx->tag_length = 0;
+ }
return dptr;
}
for (p = r; p != NULL && !founddupe; p = p->main) {
request_rec *q;
for (q = p; q != NULL; q = q->prev) {
- if ( (strcmp(q->filename, rr->filename) == 0) ||
- (strcmp(q->uri, rr->uri) == 0) ){
+ if ((q->filename && rr->filename && (strcmp(q->filename, rr->filename) == 0)) ||
+ (strcmp(q->uri, rr->uri) == 0)) {
founddupe = 1;
break;
}