[4.1] 5df35e8 Stop incorrectly reporting overflow on zeroed ws.

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Mon Sep 12 15:48:16 CEST 2016


commit 5df35e87d3c0648d99f98bf45a35f4644c4ce42a
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 08a4ad1..c475605 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -116,7 +116,7 @@ pan_ws(struct vsb *vsb, const struct ws *ws)
 	VSB_printf(vsb, "ws = %p {\n", ws);
 	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 e8f9b7f..e4a0b0c 100644
--- a/bin/varnishd/cache/cache_ws.c
+++ b/bin/varnishd/cache/cache_ws.c
@@ -254,6 +254,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