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
38f73570
Commit
38f73570
authored
Mar 19, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the assertion that VCL_INT always fits PCRE2_SIZE into the event function.
parent
0ef229c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
vmod_pcre2.c
src/vmod_pcre2.c
+9
-5
No files found.
src/vmod_pcre2.c
View file @
38f73570
...
...
@@ -154,6 +154,15 @@ event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
int
ret
;
uint32_t
where
;
/*
* A VCL_INT must never be larger than PCRE2_SIZE_MAX, so
* that some assignments from INT params cannot be out of
* range.
* XXX: C11 static_assert would catch this at compile
* time.
*/
assert
(
sizeof
(
VCL_INT
)
<=
sizeof
(
PCRE2_SIZE
));
ret
=
pcre2_config
(
PCRE2_CONFIG_JIT
,
&
where
);
assert
(
ret
>=
0
);
have_jit
=
where
;
...
...
@@ -224,11 +233,6 @@ vmod_regex__init(VRT_CTX, struct vmod_pcre2_regex **regexp,
vcl_name
);
return
;
}
/*
* assert that a VCL_INT can never be larger than PCRE2_SIZE_MAX,
* to assume that max_pattern_len can never be too large.
*/
assert
(
sizeof
(
VCL_INT
)
<=
sizeof
(
PCRE2_SIZE
));
if
(
max_pattern_length
<
0
)
{
VERR
(
ctx
,
"max_pattern_len (%lld) must be >= 0 in %s "
"constructor"
,
(
long
long
)
max_pattern_length
,
vcl_name
);
...
...
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