}
}
-static meta *metafix(request_rec *r, const char *buf)
+static meta *metafix(request_rec *r, const char *buf, apr_size_t len)
{
meta *ret = NULL;
size_t offs = 0;
ap_regmatch_t pmatch[2];
char delim;
- while (!ap_regexec(seek_meta, buf+offs, 2, pmatch, 0)) {
+ while (offs < len &&
+ !ap_regexec_len(seek_meta, buf + offs, len - offs, 2, pmatch, 0)) {
header = NULL;
content = NULL;
p = buf+offs+pmatch[1].rm_eo;
"Unsupported parser opts %x", xmlopts);
#endif
if (ctxt->cfg->metafix)
- m = metafix(f->r, buf);
+ m = metafix(f->r, buf, bytes);
if (m) {
consume_buffer(ctxt, buf, m->start, 0);
consume_buffer(ctxt, buf+m->end, bytes-m->end, 0);