mirror of
https://github.com/sheumann/hush.git
synced 2024-12-25 18:33:06 +00:00
depmod.pl: add recursive sanity check
If modules contain circular dependencies, the depmod script will follow the circle forever. So add a simple sanity check to abort rather than chew up the CPU. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
2e9aeae4db
commit
8ce1ad3097
@ -173,6 +173,9 @@ sub add_mod_deps
|
||||
|
||||
$depth .= " ";
|
||||
warn "${depth}loading deps of module: $this_module\n" if $verbose;
|
||||
if (length($depth) > 50) {
|
||||
die "too much recursion (circular dependencies in modules?)";
|
||||
}
|
||||
|
||||
foreach my $md (keys %{$mod->{$this_module}}) {
|
||||
add_mod_deps ($depth, $mod, $mod2, $module, $md);
|
||||
|
Loading…
Reference in New Issue
Block a user