[3.0] 38dd274 Don't core dump on negative or execessively large fds in "order mode"

Tollef Fog Heen tfheen at varnish-cache.org
Wed Aug 17 11:26:42 CEST 2011


commit 38dd2742d6c62123ed28e8b6ece58fbfe1020b24
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 8 12:33:41 2011 +0000

    Don't core dump on negative or execessively large fds in "order mode"
    
    XXX: the 64k fd limitation should probably be fixed.

diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index e33afba..ed29865 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -97,6 +97,10 @@ h_order(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
 
 	struct VSM_data *vd = priv;
 
+	/* XXX: Just ignore any fd not inside the bitmap */
+	if (fd >= sizeof bitmap / sizeof bitmap[0])
+		return (0);
+
 	bitmap[fd] |= bm;
 
 	type = (spec & VSL_S_CLIENT) ? 'c' :



More information about the varnish-commit mailing list