[4.0] 29867c1 Bail out on workspace exhaustion in VRT_IP_string

Lasse Karstensen lkarsten at varnish-software.com
Mon Sep 22 16:38:26 CEST 2014


commit 29867c1eae2be7d51e61711a7b6aecd579c1065c
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 edfa2a5..4ffb51a 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -304,6 +304,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