Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-pcre2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-pcre2
Commits
ccff2eb0
Commit
ccff2eb0
authored
Mar 20, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backrefs fail if the fallback is undefined.
parent
701d262f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
backref_basic.vtc
src/tests/backref_basic.vtc
+6
-0
vmod_pcre2.c
src/vmod_pcre2.c
+5
-0
No files found.
src/tests/backref_basic.vtc
View file @
ccff2eb0
...
...
@@ -85,6 +85,10 @@ varnish v1 -vcl {
set resp.http.bar-1 = barbaz.backref(-1, "error-1");
set resp.http.barinf
= barbaz.backref(4294967296, "errorinf");
# fallback is NULL
set resp.http.fallback
= barbaz.backref(0, req.http.undef);
}
# match fails
...
...
@@ -125,6 +129,7 @@ client c1 -repeat 2 {
expect resp.http.bar0 == "barbaz"
expect resp.http.bar3 == "error3"
expect resp.http.barinf == "errorinf"
expect resp.http.fallback == "**BACKREF METHOD FAILED**"
expect resp.http.frob1 == "false"
expect resp.http.frob1-0 == "error0"
expect resp.http.frob1-1 == "error1"
...
...
@@ -152,6 +157,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect * = VCL_Error "^vmod pcre2 error: in barbaz.backref.3.: unknown substring$"
expect * = VCL_Error "^vmod pcre2 error: ref .-1. out of range in barbaz.backref.. .must be >= 0 and <= 4294967295.$"
expect * = VCL_Error "^vmod pcre2 error: ref .4294967296. out of range in barbaz.backref.. .must be >= 0 and <= 4294967295.$"
expect * = VCL_Error "^vmod pcre2 error: in barbaz.backref.0.: fallback is undefined$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.0.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.1.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.2.: no match$"
...
...
src/vmod_pcre2.c
View file @
ccff2eb0
...
...
@@ -533,6 +533,11 @@ vmod_regex_backref(VRT_CTX, struct vmod_pcre2_regex *regex, VCL_INT ref,
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
regex
,
VMOD_PCRE2_REGEX_MAGIC
);
if
(
fallback
==
NULL
)
{
VERR
(
ctx
,
"in %s.backref(%ld): fallback is undefined"
,
regex
->
vcl_name
,
ref
);
return
"**BACKREF METHOD FAILED**"
;
}
CHECK_UINT32_RANGE
(
ref
,
regex
->
vcl_name
,
".backref()"
,
fallback
);
match_task
=
VRT_priv_task
(
ctx
,
regex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment