[master] 6382a1e Bail out on workspace exhaustion in VRT_IP_string
Martin Blix Grydeland
martin at varnish-software.com
Mon Sep 15 15:52:50 CEST 2014
commit 6382a1e67d7f2fc4131a80bb453e7f839a83659d
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Mon Sep 15 15:47:26 2014 +0200
Bail out on workspace exhaustion in VRT_IP_string
Fixes: #1592
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index dcb07ba..e8c5d9a 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -307,6 +307,10 @@ VRT_IP_string(const struct vrt_ctx *ctx, VCL_IP ip)
if (ip == NULL)
return (NULL);
len = WS_Reserve(ctx->ws, 0);
+ if (len == 0) {
+ WS_Release(ctx->ws, 0);
+ return (NULL);
+ }
p = ctx->ws->f;
VTCP_name(ip, p, len, NULL, 0);
WS_Release(ctx->ws, strlen(p) + 1);
More information about the varnish-commit
mailing list