#!/usr/bin/perl ####################################################################### # # Harness to test to automate earching for sprintf() bug exploit # opportunities in core and CPAN modules, see PM node 513527 # Written on 02-12-2005. Yes, it took me way too long. # # Yes, this code sucks. Yes, I am new here. And yes, I warned you. ;) # ####################################################################### use strict; use warnings; use File::Find; use SprintfBugChecker; my @dirs = @INC; my @found = (); my $crnt = ''; while(@dirs) { $crnt = shift @dirs; find(\&wanted, $crnt); } sub wanted { #else construction to save stepping my $hit = $File::Find::name; #Found file return if $hit eq $crnt; #Will otherwise be re-added, endless recursion if(-d $hit) {push @dirs, $hit} #Subdirectory, add to list of dirs to search elsif($hit =~ m/\w+(\.pm|\.pl|\.cgi)$/) {push @found, $hit} #File with ext. we want } exit 0;