[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    [master] 7b6a395 Throw 503 on exceeding max 65k Vary header constituent limit.
From:       Martin Blix Grydeland <martin () varnish-cache ! org>
Date:       2013-03-19 14:43:19
Message-ID: E1UHxl1-000496-9A () project ! varnish-software ! com
[Download RAW message or body]

commit 7b6a395c8a08308560f9617d71a4d9ac1d3c44a7
Author: Martin Blix Grydeland <martin@varnish-software.com>
Date:   Mon Mar 18 17:53:35 2013 +0100

    Throw 503 on exceeding max 65k Vary header constituent limit.

diff --git a/bin/varnishd/cache/cache_vary.c b/bin/varnishd/cache/cache_vary.c
index be98201..ba87608 100644
--- a/bin/varnishd/cache/cache_vary.c
+++ b/bin/varnishd/cache/cache_vary.c
@@ -122,7 +122,12 @@ VRY_Create(struct req *req, const struct http *hp, struct vsb **psb)
 				e--;
 			/* Encode two byte length and contents */
 			l = e - h;
-			assert(!(l & ~0xffff));
+			if (l > 0xffff - 1) {
+				VSLb(req->vsl, SLT_Error,
+				    "Vary header maximum length exceeded");
+				error = 1;
+				break;
+			}
 		} else {
 			e = h;
 			l = 0xffff;

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic