From 076bb89028ea4d27a96492b2030d873b0d78ca24 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 Jan 2009 17:32:08 +0100 Subject: expand-includes: Add simple protection against infinite recursion. --- source3/script/expand-includes.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3') diff --git a/source3/script/expand-includes.pl b/source3/script/expand-includes.pl index da64363081..33fc44b267 100755 --- a/source3/script/expand-includes.pl +++ b/source3/script/expand-includes.pl @@ -3,9 +3,13 @@ # Copyright (C) 2009 Jelmer Vernooij # Published under the GNU GPLv3 or later +my $depth = 0; + sub process($) { my ($f) = @_; + $depth++; + die("Recursion in $f?") if ($depth > 100); open(IN, $f) or die("Unable to open $f: $!"); foreach () { my $l = $_; @@ -15,6 +19,7 @@ sub process($) print $l; } } + $depth--; } my $path = shift; -- cgit