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
This commit is contained in:
ligc 2010-09-25 03:08:46 +00:00
parent 770c12f750
commit dbce719093

View File

@ -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];