Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
3beb5c8b
Unverified
Commit
3beb5c8b
authored
Oct 10, 2022
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missed adjustments to vsl buffer space checks
Refs
8df30240
Fixes #3856
parent
322941b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
4 deletions
+51
-4
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+4
-4
r03856.vtc
bin/varnishtest/tests/r03856.vtc
+47
-0
No files found.
bin/varnishd/cache/cache_shmlog.c
View file @
3beb5c8b
...
...
@@ -382,18 +382,18 @@ VSLbs(struct vsl_log *vsl, enum VSL_tag_e tag, const struct strands *s)
/* including NUL */
l
=
vmin_t
(
unsigned
,
strands_len
(
s
)
+
1
,
mlen
);
assert
(
vsl
->
wlp
<
vsl
->
wle
);
assert
(
vsl
->
wlp
<
=
vsl
->
wle
);
/* Flush if necessary */
if
(
VSL_END
(
vsl
->
wlp
,
l
)
>
=
vsl
->
wle
)
if
(
VSL_END
(
vsl
->
wlp
,
l
)
>
vsl
->
wle
)
VSL_Flush
(
vsl
,
1
);
assert
(
VSL_END
(
vsl
->
wlp
,
l
)
<
vsl
->
wle
);
assert
(
VSL_END
(
vsl
->
wlp
,
l
)
<
=
vsl
->
wle
);
mlen
=
strands_cat
(
VSL_DATA
(
vsl
->
wlp
),
l
,
s
);
assert
(
l
==
mlen
);
vsl
->
wlp
=
vsl_hdr
(
tag
,
vsl
->
wlp
,
l
,
vsl
->
wid
);
assert
(
vsl
->
wlp
<
vsl
->
wle
);
assert
(
vsl
->
wlp
<
=
vsl
->
wle
);
vsl
->
wlr
++
;
if
(
DO_DEBUG
(
DBG_SYNCVSL
))
...
...
bin/varnishtest/tests/r03856.vtc
0 → 100644
View file @
3beb5c8b
varnishtest "Regression test off-by-one in VSLbs"
# vsl_buffer=257 bytes - 2 bytes header -> 255 bytes
varnish v1 -arg "-p vsl_buffer=267" -vcl {
import debug;
backend b None;
sub vcl_recv {
# Assert error in VSLbs(), cache/cache_shmlog.c line 385:
# Condition(vsl->wlp < vsl->wle) not true.
debug.vsl_flush();
set req.http.a =
# 255 = "a: " + 8 * 32 - 4
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789ab";
debug.return_strands("xyz");
# Assert error in VSLbs(), cache/cache_shmlog.c line 390:
# Condition(VSL_END(vsl->wlp, l) < vsl->wle) not true.
debug.vsl_flush();
debug.return_strands(
# 255 = 8 * 32 - 1
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcdef" +
"0123456789abcdef0123456789abcde");
return (synth(200));
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
} -run
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