Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Nils Goroll
libvmod-re2
Commits
7eacc5df
Commit
7eacc5df
authored
Mar 29, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for workspace overflow after calling WS_Reserve()
parent
452fab32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
vmod_re2.c
src/vmod_re2.c
+10
-0
No files found.
src/vmod_re2.c
View file @
7eacc5df
...
@@ -248,6 +248,11 @@ sub(VRT_CTX, vre2 * restrict vre2, const int all, VCL_STRING text,
...
@@ -248,6 +248,11 @@ sub(VRT_CTX, vre2 * restrict vre2, const int all, VCL_STRING text,
ret
=
WS_Snapshot
(
ctx
->
ws
);
ret
=
WS_Snapshot
(
ctx
->
ws
);
bytes
=
WS_Reserve
(
ctx
->
ws
,
0
);
bytes
=
WS_Reserve
(
ctx
->
ws
,
0
);
if
(
bytes
==
0
)
{
VERR
(
ctx
,
ERR_PREFIX
"workspace overflow"
,
text
,
rewrite
,
fallback
);
return
fallback
;
}
if
((
err
=
vre2_replace
(
vre2
,
all
,
text
,
rewrite
,
ret
,
bytes
,
&
match
,
if
((
err
=
vre2_replace
(
vre2
,
all
,
text
,
rewrite
,
ret
,
bytes
,
&
match
,
&
len
))
&
len
))
!=
NULL
)
{
!=
NULL
)
{
...
@@ -278,6 +283,11 @@ extract(VRT_CTX, vre2 * restrict vre2, VCL_STRING text, VCL_STRING rewrite,
...
@@ -278,6 +283,11 @@ extract(VRT_CTX, vre2 * restrict vre2, VCL_STRING text, VCL_STRING rewrite,
ret
=
WS_Snapshot
(
ctx
->
ws
);
ret
=
WS_Snapshot
(
ctx
->
ws
);
bytes
=
WS_Reserve
(
ctx
->
ws
,
0
);
bytes
=
WS_Reserve
(
ctx
->
ws
,
0
);
if
(
bytes
==
0
)
{
VERR
(
ctx
,
ERR_PREFIX
"workspace overflow"
,
text
,
rewrite
,
fallback
);
return
fallback
;
}
if
((
err
=
vre2_extract
(
vre2
,
text
,
rewrite
,
ret
,
bytes
,
&
match
,
&
len
))
if
((
err
=
vre2_extract
(
vre2
,
text
,
rewrite
,
ret
,
bytes
,
&
match
,
&
len
))
!=
NULL
)
{
!=
NULL
)
{
VERR
(
ctx
,
ERR_PREFIX
"%s"
,
text
,
rewrite
,
fallback
,
err
);
VERR
(
ctx
,
ERR_PREFIX
"%s"
,
text
,
rewrite
,
fallback
,
err
);
...
...
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