Fix startoffset for buffer copy

When we have a partial match and no buffer, we copy all of ptr/len and
thus must not touch the startoffset.

We could also copy from startoffset, but that could break lookbehinds,
so don't.
parent 364f5062
......@@ -46,6 +46,12 @@ client c1 -repeat 4 {
expect resp.status == 200
expect resp.http.all == "a=123,b=43875643543;"
# simple case - all in one, C-l, 2 matches
txreq -body "saldkhaskdhsaks&a=123&sadsadjhsakdh82378e3d&b=43875643543&foobar&a=3&zzz&b=333"
rxresp
expect resp.status == 200
expect resp.http.all == "a=123,b=43875643543;a=3,b=333;"
txreq -nolen -hdr "Transfer-encoding: chunked"
chunked "a="
chunked "12"
......@@ -61,6 +67,21 @@ client c1 -repeat 4 {
expect resp.status == 200
expect resp.http.all == "a=123,b=43875643543;a=456,b=782103879213;"
# 2 matches
txreq -nolen -hdr "Transfer-encoding: chunked"
chunked "a="
chunked "12"
chunked "3&sadsadjhsakdh82378e3d&b=43"
chunked "875643543&"
chunked "saldkhaskdhs"
chunked "&a=3"
chunked "&zzz&"
chunked "b=333"
chunkedlen 0
rxresp
expect resp.status == 200
expect resp.http.all == "a=123,b=43875643543;a=3,b=333;"
txreq -nolen -hdr "Transfer-encoding: chunked"
chunked "&&&"
......
......@@ -591,7 +591,6 @@ reip_iter(struct re_iter_priv *reip, unsigned flush,
AN(reip->buf);
memcpy(reip->buf, ptr, len);
reip->len = len;
reip->startoffset = ov->ovector[0];
return (0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment