Commit 5c185885 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Clip negative values before they do any damage.

parent 2673c16a
...@@ -230,11 +230,14 @@ VCL_VOID __match_proto__(td_std_cache_req_body) ...@@ -230,11 +230,14 @@ VCL_VOID __match_proto__(td_std_cache_req_body)
vmod_cache_req_body(VRT_CTX, VCL_BYTES size) vmod_cache_req_body(VRT_CTX, VCL_BYTES size)
{ {
int result; int result;
ssize_t ss;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
result = VRT_CacheReqBody(ctx, size); if (size < 0)
VSLb(ctx->vsl, SLT_Debug, "VRT_CacheReqBody(%zu): %d", size = 0;
(size_t)size, result); ss = (ssize_t)size;
result = VRT_CacheReqBody(ctx, ss);
VSLb(ctx->vsl, SLT_Debug, "VRT_CacheReqBody(%zd): %d", ss, result);
} }
VCL_STRING __match_proto__(td_std_strstr) VCL_STRING __match_proto__(td_std_strstr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment