From f91d79f469956c423373c8747c92218c668f0ba8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 28 Jan 2010 21:07:23 -0500 Subject: img: Fix a bug that could taint @links with undef values. --- IkiWiki/Plugin/img.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'IkiWiki/Plugin/img.pm') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index c1048d3c9..82db15a7e 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -26,6 +26,10 @@ sub preprocess (@) { my ($image) = $_[0] =~ /$config{wiki_file_regexp}/; # untaint my %params=@_; + if (! defined $image) { + error("bad image filename"); + } + if (exists $imgdefaults{$params{page}}) { foreach my $key (keys %{$imgdefaults{$params{page}}}) { if (! exists $params{$key}) { -- cgit v1.2.3