[master] ad42abd fix LostHeader message in http_PrintfHeader

Nils Goroll nils.goroll at uplex.de
Tue Jun 28 20:37:07 CEST 2016


commit ad42abd533a0410be656defab542e110c1aa8338
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jun 28 20:27:39 2016 +0200

    fix LostHeader message in http_PrintfHeader
    
    When out of workspace, we dumped the piece of memory at the ws free pointer,
    which does not necessarily contain anything sensible in this situation.

diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index d6bfb28..53e4b1d 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -1149,7 +1149,8 @@ http_PrintfHeader(struct http *to, const char *fmt, ...)
 	va_end(ap);
 	if (n + 1 >= l || to->nhd >= to->shd) {
 		http_fail(to);
-		VSLb(to->vsl, SLT_LostHeader, "%s", to->ws->f);
+		VSLb(to->vsl, SLT_LostHeader, "%s",
+		    n + 1 >= l ? fmt : to->ws->f);
 		WS_Release(to->ws, 0);
 		return;
 	}



More information about the varnish-commit mailing list