From dbce7190934261e2695216503fb83b783c70614e Mon Sep 17 00:00:00 2001 From: ligc Date: Sat, 25 Sep 2010 03:08:46 +0000 Subject: [PATCH] fix for bug 3073397: check the parameter passed to subroutines git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7624 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NetworkUtils.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index bcd34a8cb..fa51d5691 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -102,6 +102,11 @@ sub gethostname() { my ($class, $iporhost) = @_; + if (!defined($iporhost)) + { + return undef; + } + if (ref($iporhost) eq 'ARRAY') { $iporhost = @{$iporhost}[0]; @@ -177,6 +182,11 @@ sub getipaddr() { my ($class, $iporhost) = @_; + if (!defined($iporhost)) + { + return undef; + } + if (ref($iporhost) eq 'ARRAY') { $iporhost = @{$iporhost}[0];