[experimental-ims] 573e86f Don't core dump on negative or execessively large fds in "order mode"

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:00:16 CEST 2011


commit 573e86f890ab3d96fa9fe7bff3f83b7ab69997ba
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