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
543e45e8
Commit
543e45e8
authored
Feb 23, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an assert to ensure we never go into a simple stevedore with
a request for zero bytes. Suggested by: github::onovy
parent
0be53bce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
storage_simple.c
bin/varnishd/storage/storage_simple.c
+2
-1
No files found.
bin/varnishd/storage/storage_simple.c
View file @
543e45e8
...
@@ -55,6 +55,7 @@ sml_stv_alloc(const struct stevedore *stv, size_t size)
...
@@ -55,6 +55,7 @@ sml_stv_alloc(const struct stevedore *stv, size_t size)
for
(;;)
{
for
(;;)
{
/* try to allocate from it */
/* try to allocate from it */
assert
(
size
>
0
);
AN
(
stv
->
sml_alloc
);
AN
(
stv
->
sml_alloc
);
st
=
stv
->
sml_alloc
(
stv
,
size
);
st
=
stv
->
sml_alloc
(
stv
,
size
);
if
(
st
!=
NULL
)
if
(
st
!=
NULL
)
...
@@ -132,6 +133,7 @@ SML_allocobj(struct worker *wrk, const struct stevedore *stv,
...
@@ -132,6 +133,7 @@ SML_allocobj(struct worker *wrk, const struct stevedore *stv,
return
(
0
);
return
(
0
);
really
--
;
really
--
;
}
}
AN
(
stv
->
sml_alloc
);
st
=
stv
->
sml_alloc
(
stv
,
ltot
);
st
=
stv
->
sml_alloc
(
stv
,
ltot
);
if
(
st
!=
NULL
&&
st
->
space
<
ltot
)
{
if
(
st
!=
NULL
&&
st
->
space
<
ltot
)
{
stv
->
sml_free
(
st
);
stv
->
sml_free
(
st
);
...
@@ -324,7 +326,6 @@ objallocwithnuke(struct worker *wrk, const struct stevedore *stv, size_t size)
...
@@ -324,7 +326,6 @@ objallocwithnuke(struct worker *wrk, const struct stevedore *stv, size_t size)
for
(
fail
=
0
;
fail
<=
cache_param
->
nuke_limit
;
fail
++
)
{
for
(
fail
=
0
;
fail
<=
cache_param
->
nuke_limit
;
fail
++
)
{
/* try to allocate from it */
/* try to allocate from it */
AN
(
stv
->
sml_alloc
);
st
=
sml_stv_alloc
(
stv
,
size
);
st
=
sml_stv_alloc
(
stv
,
size
);
if
(
st
!=
NULL
)
if
(
st
!=
NULL
)
break
;
break
;
...
...
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