[3.0] 1b6cc9d Fix v-c.o bug 1327 (http_max_hdr not multiple of 4) also for 3.0

Martin Blix Grydeland martin at varnish-software.com
Mon Jun 2 13:14:44 CEST 2014


commit 1b6cc9d28eb3741292d8b87c033c08f1590dd166
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Jun 2 13:11:47 2014 +0200

    Fix v-c.o bug 1327 (http_max_hdr not multiple of 4) also for 3.0
    
    Round up the header space with PRNDUP in session space allocation to
    fix alignment issue.
    
    Fixes: #1327

diff --git a/bin/varnishd/cache_session.c b/bin/varnishd/cache_session.c
index d94ac7b..9ea5333 100644
--- a/bin/varnishd/cache_session.c
+++ b/bin/varnishd/cache_session.c
@@ -117,6 +117,7 @@ ses_sm_alloc(void)
 	nws = params->sess_workspace;
 	nhttp = (uint16_t)params->http_max_hdr;
 	hl = HTTP_estimate(nhttp);
+	hl = PRNDUP(hl);
 	l = sizeof *sm + nws + 2 * hl;
 	p = malloc(l);
 	if (p == NULL)
diff --git a/bin/varnishtest/tests/r01327.vtc b/bin/varnishtest/tests/r01327.vtc
new file mode 100644
index 0000000..241b65d
--- /dev/null
+++ b/bin/varnishtest/tests/r01327.vtc
@@ -0,0 +1,14 @@
+varnishtest "#1327 http_max_hdr not multiple of 4"
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -arg "-p http_max_hdr=65" -vcl+backend {
+} -start
+
+client c1 {
+	txreq
+	rxresp
+} -run



More information about the varnish-commit mailing list