From 2732392088cf713898882e54561a20a84b1b6538 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Apr 2018 15:18:00 -0400 Subject: [PATCH] fix use of uninitialized value in escapeshellparam() --- syncoid | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/syncoid b/syncoid index 10c78c1..df08122 100755 --- a/syncoid +++ b/syncoid @@ -1087,11 +1087,14 @@ sub getdate { } sub escapeshellparam { - my $par; - if (scalar @_) { - ($par) = @_; + my ($par) = @_; + # avoid use of uninitialized string in regex + if (length($par)) { # "escape" all single quotes $par =~ s/'/'"'"'/g; + } else { + # avoid use of uninitialized string in concatenation below + $par = ''; } # single-quote entire string return "'$par'";