[master] 11692e7 Stop incorrectly reporting overflow on zeroed ws.

Lasse Karstensen lkarsten at varnish-software.com
Thu Jul 7 15:50:08 CEST 2016


commit 11692e77597909e0e427482639158ba765e5c017
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date:   Thu Jul 7 15:36:07 2016 +0200

    Stop incorrectly reporting overflow on zeroed ws.
    
    Ref: #2008

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 285c9ff..ffe6fd1 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -157,7 +157,7 @@ pan_ws(struct vsb *vsb, const struct ws *ws)
 		return;
 	VSB_indent(vsb, 2);
 	PAN_CheckMagic(vsb, ws, WS_MAGIC);
-	if (!(ws->id[0] & 0x20))
+	if (ws->id[0] != '\0' && (!(ws->id[0] & 0x20)))
 		VSB_printf(vsb, "OVERFLOWED ");
 	VSB_printf(vsb, "id = \"%s\",\n", ws->id);
 	VSB_printf(vsb, "{s, f, r, e} = {%p", ws->s);
diff --git a/bin/varnishd/cache/cache_ws.c b/bin/varnishd/cache/cache_ws.c
index 8666b35..36989fc 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -257,6 +257,7 @@ int
 WS_Overflowed(const struct ws *ws)
 {
 	CHECK_OBJ_NOTNULL(ws, WS_MAGIC);
+	AN(ws->id[0]);
 
 	if (ws->id[0] & 0x20)
 		return (0);



More information about the varnish-commit mailing list