[master] cd4bb90 Ignore fd's larger than 65536 in varnishncsa

Martin Blix Grydeland martin at varnish-cache.org
Tue Jan 22 13:20:35 CET 2013

commit cd4bb90edbaceef996a028620e7f35d6ecac3aa1
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Jan 22 13:15:06 2013 +0100

    Ignore fd's larger than 65536 in varnishncsa
    This makes varnishncsa behave the same way as varnishlog, and prevents
    overly large memory allocations if it should see a bogus fd (shmlog
    XXX: This will not fix varnishncsa for current trunk, as that is using
    XIDs instead of FDs breaking some functionality in the tools. This
    will be handled in the API rewrite.

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 2a4bc21..e9359cd 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -586,6 +586,10 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
 	const char *p;
 	struct vsb *os;
+	/* XXX: Ignore fd's outside 65536 */
+	if (fd >= 65536)
+		return (reopen);
 	if (fd >= nll) {
 		struct logline **newll = ll;
 		size_t newnll = nll;

More information about the varnish-commit mailing list