summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-06-11 10:40:48 +0100
committerRichard Jones <rjones@redhat.com>2010-06-11 10:40:48 +0100
commite67e216118df3a724482cb698a868ecbaacbf326 (patch)
treeccecf5c80d12fac6f83773610a7083e43360dafe /perl
parenteb566f7dc7974b42ac65729a2e5e5bcee329a0a9 (diff)
downloadlibguestfs-e67e216118df3a724482cb698a868ecbaacbf326.tar.gz
libguestfs-e67e216118df3a724482cb698a868ecbaacbf326.tar.xz
libguestfs-e67e216118df3a724482cb698a868ecbaacbf326.zip
perl: Check all images are defined in first param of open_guest.
Diffstat (limited to 'perl')
-rw-r--r--perl/lib/Sys/Guestfs/Lib.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm
index 128f7c9f..bdc788e8 100644
--- a/perl/lib/Sys/Guestfs/Lib.pm
+++ b/perl/lib/Sys/Guestfs/Lib.pm
@@ -152,6 +152,13 @@ sub open_guest
croak __"open_guest: first parameter must be a string or an arrayref"
}
+ # Check each element of @images is defined.
+ # (See https://bugzilla.redhat.com/show_bug.cgi?id=601092#c3).
+ foreach (@images) {
+ croak __"open_guest: first argument contains undefined element"
+ unless defined $_;
+ }
+
my ($conn, $dom);
if (-e $images[0]) {