[master] 7e0708375 Check we have space before adding the Date header
Federico G. Schwindt
fgsch at lodoss.net
Mon Oct 8 09:32:08 UTC 2018
commit 7e07083754527744996e4c2e076ed1c7acc6633d
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Mon Oct 8 10:23:38 2018 +0100
Check we have space before adding the Date header
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index 30988ab56..23eaa0b18 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -1233,6 +1233,11 @@ http_TimeHeader(struct http *to, const char *fmt, double now)
char *p;
CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
+ if (to->nhd >= to->shd) {
+ VSLb(to->vsl, SLT_LostHeader, "%s", fmt);
+ http_fail(to);
+ return;
+ }
p = WS_Alloc(to->ws, strlen(fmt) + VTIM_FORMAT_SIZE);
if (p == NULL) {
http_fail(to);
More information about the varnish-commit
mailing list