mirror of https://github.com/jimsalterjrs/sanoid
fix use of uninitialized value in escapeshellparam()
This commit is contained in:
parent
4ebc0abef5
commit
2732392088
9
syncoid
9
syncoid
|
|
@ -1087,11 +1087,14 @@ sub getdate {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub escapeshellparam {
|
sub escapeshellparam {
|
||||||
my $par;
|
my ($par) = @_;
|
||||||
if (scalar @_) {
|
# avoid use of uninitialized string in regex
|
||||||
($par) = @_;
|
if (length($par)) {
|
||||||
# "escape" all single quotes
|
# "escape" all single quotes
|
||||||
$par =~ s/'/'"'"'/g;
|
$par =~ s/'/'"'"'/g;
|
||||||
|
} else {
|
||||||
|
# avoid use of uninitialized string in concatenation below
|
||||||
|
$par = '';
|
||||||
}
|
}
|
||||||
# single-quote entire string
|
# single-quote entire string
|
||||||
return "'$par'";
|
return "'$par'";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue