Skip to content
Permalink
Browse files

Only fail on workspace exhaustion if we actually need it.

  • Loading branch information...
bsdphk committed Sep 9, 2019
1 parent 26e4fed commit 98dc17709df79b91b964c79472af3b09779f481f
Showing with 10 additions and 6 deletions.
  1. +10 −6 bin/varnishd/cache/cache_vrt.c
@@ -513,20 +513,24 @@ VRT_UpperLowerStrands(VRT_CTX, VCL_STRANDS s, int up)
(!up && vct_isupper(*p))) {
*b++ = *p ^ 0x20;
copy = 1;
} else {
} else if (b < e) {
*b++ = *p;
}
if (b == e) {
WS_Release(ctx->ws, 0);
VRT_fail(ctx, "Workspace overflow");
return (NULL);
}
if (copy && b == e)
break;
}
if (copy && b == e) {
WS_Release(ctx->ws, 0);
VRT_fail(ctx, "Workspace overflow");
return (NULL);
}
}
assert(b <= e);
if (!copy) {
WS_Release(ctx->ws, 0);
return (q);
}
assert(b < e);
*b++ = '\0';
assert(b <= e);
WS_ReleaseP(ctx->ws, b);

0 comments on commit 98dc177

Please sign in to comment.
You can’t perform that action at this time.