Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re
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-re
Commits
5ed09a7a
Commit
5ed09a7a
authored
Nov 22, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cosmetic pointer cleanup
parent
9a2b0ae3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
vmod_re.c
src/vmod_re.c
+6
-6
No files found.
src/vmod_re.c
View file @
5ed09a7a
...
...
@@ -192,6 +192,7 @@ VCL_STRING __match_proto__()
vmod_regex_backref
(
const
struct
vrt_ctx
*
ctx
,
struct
vmod_re_regex
*
re
,
VCL_INT
refnum
,
VCL_STRING
fallback
)
{
void
*
p
;
ov_t
*
ov
;
char
*
substr
;
unsigned
l
;
...
...
@@ -208,18 +209,17 @@ vmod_regex_backref(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
return
fallback
;
}
ov
=
(
ov_t
*
)
pthread_getspecific
(
re
->
ovk
);
if
(
ov
==
NULL
)
{
p
=
pthread_getspecific
(
re
->
ovk
);
if
(
p
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_VCL_Error
,
"vmod re: backref called without prior match"
);
return
fallback
;
}
if
(
(
void
*
)
ov
==
match_failed
)
if
(
p
==
match_failed
)
return
fallback
;
C
HECK_OBJ
(
ov
,
OV_MAGIC
);
C
AST_OBJ
(
ov
,
p
,
OV_MAGIC
);
assert
((
char
*
)
ov
>=
ctx
->
ws
->
s
&&
(
char
*
)
ov
<
ctx
->
ws
->
e
);
AN
(
ov
->
subject
);
assert
(
ov
->
subject
>=
ctx
->
ws
->
s
&&
ov
->
subject
<
ctx
->
ws
->
e
);
assert
(
ov
->
count
>
0
&&
ov
->
count
<=
MAX_MATCHES
);
...
...
@@ -239,7 +239,7 @@ vmod_regex_backref(const struct vrt_ctx *ctx, struct vmod_re_regex *re,
WS_Release
(
ctx
->
ws
,
0
);
return
fallback
;
}
assert
(
len
<=
strlen
(
ov
->
subject
+
ov
->
ovector
[
refnum
])
+
1
);
assert
(
len
<=
strlen
(
ov
->
subject
+
ov
->
ovector
[
refnum
]));
memcpy
(
substr
,
ov
->
subject
+
ov
->
ovector
[
refnum
],
len
);
substr
[
len
]
=
'\0'
;
...
...
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