Permalink
Browse files

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

  • Loading branch information...
1 parent f5c42c6 commit 7b6a395c8a08308560f9617d71a4d9ac1d3c44a7 @mbgrydeland mbgrydeland committed Mar 18, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 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;

0 comments on commit 7b6a395

Please sign in to comment.