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:
parent
770c12f750
commit
dbce719093
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user